Blame SOURCES/0263-Replace-8-with-GRUB_CHAR_BIT-in-several-places-when-.patch

f96e0b
From 7f2a48513c893b2d17b6b920adc89a64ea279e08 Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Fri, 5 Apr 2013 10:59:26 +0200
f96e0b
Subject: [PATCH 263/482] 	Replace 8 with GRUB_CHAR_BIT in several places
f96e0b
 when appropriate.
f96e0b
f96e0b
---
f96e0b
 ChangeLog                    | 4 ++++
f96e0b
 grub-core/disk/cryptodisk.c  | 2 +-
f96e0b
 grub-core/disk/efi/efidisk.c | 2 +-
f96e0b
 grub-core/disk/geli.c        | 2 +-
f96e0b
 4 files changed, 7 insertions(+), 3 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index 3431895..7e2a62f 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,5 +1,9 @@
f96e0b
 2013-04-05  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
+	Replace 8 with GRUB_CHAR_BIT in several places when appropriate.
f96e0b
+
f96e0b
+2013-04-05  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
+
f96e0b
 	Add new defines GRUB_RSDP_SIGNATURE_SIZE and GRUB_RSDP_SIGNATURE.
f96e0b
 
f96e0b
 2013-04-05  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c
f96e0b
index 374edd1..5b12a23 100644
f96e0b
--- a/grub-core/disk/cryptodisk.c
f96e0b
+++ b/grub-core/disk/cryptodisk.c
f96e0b
@@ -103,7 +103,7 @@ gf_mul_be (grub_uint8_t *o, const grub_uint8_t *a, const grub_uint8_t *b)
f96e0b
   grub_memcpy (t, b, GRUB_CRYPTODISK_GF_BYTES);
f96e0b
   for (i = 0; i < GRUB_CRYPTODISK_GF_SIZE; i++)
f96e0b
     {
f96e0b
-      if (((a[GRUB_CRYPTODISK_GF_BYTES - i / 8 - 1] >> (i % 8))) & 1)
f96e0b
+      if (((a[GRUB_CRYPTODISK_GF_BYTES - i / GRUB_CHAR_BIT - 1] >> (i % GRUB_CHAR_BIT))) & 1)
f96e0b
 	grub_crypto_xor (o, o, t, GRUB_CRYPTODISK_GF_BYTES);
f96e0b
       gf_mul_x_be (t);
f96e0b
     }
f96e0b
diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c
f96e0b
index 0a364f1..28b9fa1 100644
f96e0b
--- a/grub-core/disk/efi/efidisk.c
f96e0b
+++ b/grub-core/disk/efi/efidisk.c
f96e0b
@@ -501,7 +501,7 @@ grub_efidisk_open (const char *name, struct grub_disk *disk)
f96e0b
   if (! d)
f96e0b
     return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device");
f96e0b
 
f96e0b
-  disk->id = ((num << 8) | name[0]);
f96e0b
+  disk->id = ((num << GRUB_CHAR_BIT) | name[0]);
f96e0b
   m = d->block_io->media;
f96e0b
   /* FIXME: Probably it is better to store the block size in the disk,
f96e0b
      and total sectors should be replaced with total blocks.  */
f96e0b
diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c
f96e0b
index 0b94414..55aa5b9 100644
f96e0b
--- a/grub-core/disk/geli.c
f96e0b
+++ b/grub-core/disk/geli.c
f96e0b
@@ -414,7 +414,7 @@ recover_key (grub_disk_t source, grub_cryptodisk_t dev)
f96e0b
   if (err)
f96e0b
     return err;
f96e0b
 
f96e0b
-  keysize = grub_le_to_cpu16 (header.keylen) / 8;
f96e0b
+  keysize = grub_le_to_cpu16 (header.keylen) / GRUB_CHAR_BIT;
f96e0b
   grub_memset (zero, 0, sizeof (zero));
f96e0b
 
f96e0b
   grub_puts_ (N_("Attempting to decrypt master key..."));
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b