a5bd9f6
From fc8c72d6ad43b3fd7a960e67bbacd6fe8d68e48a Mon Sep 17 00:00:00 2001
a5bd9f6
From: Colin Watson <cjwatson@ubuntu.com>
a5bd9f6
Date: Wed, 19 Sep 2012 02:41:51 +0100
a5bd9f6
Subject: [PATCH 043/364] * util/grub-setup.c (write_rootdev): Remove unused
a5bd9f6
 core_img parameter.  Update all callers. (setup): Define core_sectors only if
a5bd9f6
 GRUB_SETUP_BIOS, to appease 'gcc -Wunused-but-set-variable'.  Remove
a5bd9f6
 unnecessary nested #ifdef GRUB_SETUP_BIOS.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog         | 10 +++++++++-
a5bd9f6
 util/grub-setup.c | 12 +++++++-----
a5bd9f6
 2 files changed, 16 insertions(+), 6 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index 32849c6..1ab401d 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,3 +1,11 @@
a5bd9f6
+2012-09-19  Colin Watson  <cjwatson@ubuntu.com>
a5bd9f6
+
a5bd9f6
+	* util/grub-setup.c (write_rootdev): Remove unused core_img
a5bd9f6
+	parameter.  Update all callers.
a5bd9f6
+	(setup): Define core_sectors only if GRUB_SETUP_BIOS, to appease
a5bd9f6
+	'gcc -Wunused-but-set-variable'.  Remove unnecessary nested #ifdef
a5bd9f6
+	GRUB_SETUP_BIOS.
a5bd9f6
+
a5bd9f6
 2012-09-18  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
 
a5bd9f6
 	* util/grub-mkconfig_lib.in (grub_tab): New variable.
a5bd9f6
@@ -29,7 +37,7 @@
a5bd9f6
 	le-conversion.
a5bd9f6
 	Reported by: BURETTE, Bernard.
a5bd9f6
 
a5bd9f6
-2012-09-17  Colin Watson  <cjwatson@debian.org>
a5bd9f6
+2012-09-17  Colin Watson  <cjwatson@ubuntu.com>
a5bd9f6
 
a5bd9f6
 	* util/grub-mkconfig_lib.in (grub_quote): Remove outdated sentence
a5bd9f6
 	from comment.
a5bd9f6
diff --git a/util/grub-setup.c b/util/grub-setup.c
a5bd9f6
index 085e8df..de0417f 100644
a5bd9f6
--- a/util/grub-setup.c
a5bd9f6
+++ b/util/grub-setup.c
a5bd9f6
@@ -105,7 +105,7 @@
a5bd9f6
 #endif
a5bd9f6
 
a5bd9f6
 static void
a5bd9f6
-write_rootdev (char *core_img, grub_device_t root_dev,
a5bd9f6
+write_rootdev (grub_device_t root_dev,
a5bd9f6
 	       char *boot_img, grub_uint64_t first_sector)
a5bd9f6
 {
a5bd9f6
 #ifdef GRUB_SETUP_BIOS
a5bd9f6
@@ -148,7 +148,9 @@ setup (const char *dir,
a5bd9f6
   char *boot_img, *core_img;
a5bd9f6
   char *root = 0;
a5bd9f6
   size_t boot_size, core_size;
a5bd9f6
+#ifdef GRUB_SETUP_BIOS
a5bd9f6
   grub_uint16_t core_sectors;
a5bd9f6
+#endif
a5bd9f6
   grub_device_t root_dev = 0, dest_dev, core_dev;
a5bd9f6
   struct grub_boot_blocklist *first_block, *block;
a5bd9f6
   char *tmp_img;
a5bd9f6
@@ -229,8 +231,10 @@ setup (const char *dir,
a5bd9f6
 
a5bd9f6
   core_path = grub_util_get_path (dir, core_file);
a5bd9f6
   core_size = grub_util_get_image_size (core_path);
a5bd9f6
+#ifdef GRUB_SETUP_BIOS
a5bd9f6
   core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1)
a5bd9f6
 		  >> GRUB_DISK_SECTOR_BITS);
a5bd9f6
+#endif
a5bd9f6
   if (core_size < GRUB_DISK_SECTOR_SIZE)
a5bd9f6
     grub_util_error (_("the size of `%s' is too small"), core_path);
a5bd9f6
 #ifdef GRUB_SETUP_BIOS
a5bd9f6
@@ -386,7 +390,6 @@ setup (const char *dir,
a5bd9f6
 
a5bd9f6
     is_ldm = grub_util_is_ldm (dest_dev->disk);
a5bd9f6
 
a5bd9f6
-#ifdef GRUB_SETUP_BIOS
a5bd9f6
     if (fs_probe)
a5bd9f6
       {
a5bd9f6
 	if (!fs && !dest_partmap)
a5bd9f6
@@ -424,7 +427,6 @@ setup (const char *dir,
a5bd9f6
 			   dest_dev->disk->name, dest_partmap->name);
a5bd9f6
 
a5bd9f6
       }
a5bd9f6
-#endif
a5bd9f6
 
a5bd9f6
     /* Copy the partition table.  */
a5bd9f6
     if (dest_partmap ||
a5bd9f6
@@ -520,7 +522,7 @@ setup (const char *dir,
a5bd9f6
     block->len = 0;
a5bd9f6
     block->segment = 0;
a5bd9f6
 
a5bd9f6
-    write_rootdev (core_img, root_dev, boot_img, first_sector);
a5bd9f6
+    write_rootdev (root_dev, boot_img, first_sector);
a5bd9f6
 
a5bd9f6
     core_img = realloc (core_img, nsec * GRUB_DISK_SECTOR_SIZE);
a5bd9f6
     first_block = (struct grub_boot_blocklist *) (core_img
a5bd9f6
@@ -858,7 +860,7 @@ unable_to_embed:
a5bd9f6
   free (core_path_dev);
a5bd9f6
   free (tmp_img);
a5bd9f6
 
a5bd9f6
-  write_rootdev (core_img, root_dev, boot_img, first_sector);
a5bd9f6
+  write_rootdev (root_dev, boot_img, first_sector);
a5bd9f6
 
a5bd9f6
   /* Write the first two sectors of the core image onto the disk.  */
a5bd9f6
   grub_util_info ("opening the core image `%s'", core_path);
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6