+2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/fs/zfs/zfs.c (xor_out): Use unsigned modular arithmetics
+ rather than signed one.
+ (recovery): Likewise.
+
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/net/dns.c (hash): Use unsigned arithmetic.
/* perform the operation a ^= b * (x ** (known_idx * recovery_pow) ) */
static inline void
xor_out (grub_uint8_t *a, const grub_uint8_t *b, grub_size_t s,
- int known_idx, int recovery_pow)
+ unsigned known_idx, unsigned recovery_pow)
{
- int add;
+ unsigned add;
/* Simple xor. */
if (known_idx == 0 || recovery_pow == 0)
static grub_err_t
recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs,
const unsigned *powers,
- const int *idx)
+ const unsigned *idx)
{
grub_dprintf ("zfs", "recovering %u buffers\n", nbufs);
/* Now we have */
grub_size_t orig_len = len;
grub_uint8_t *recovery_buf[4];
grub_size_t recovery_len[4];
- int recovery_idx[4];
+ unsigned recovery_idx[4];
unsigned failed_devices = 0;
int idx, orig_idx;