From 9c68bb670dcdb29d44ab474ae7041122db2de69f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 5 Sep 2012 01:04:38 +0100 Subject: [PATCH] Fix compiler warnings when building grub-ieee1275 for i386. --- debian/patches/olpc_prefix_hack.patch | 30 ++++++++++++--------------- grub-core/kern/ieee1275/init.c | 15 ++++++++------ 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/debian/patches/olpc_prefix_hack.patch b/debian/patches/olpc_prefix_hack.patch index fa483e1e5..3099d5880 100644 --- a/debian/patches/olpc_prefix_hack.patch +++ b/debian/patches/olpc_prefix_hack.patch @@ -13,7 +13,7 @@ Index: b/grub-core/kern/ieee1275/init.c /* Translate an OF filesystem path (separated by backslashes), into a GRUB path (separated by forward slashes). */ static void -@@ -75,6 +76,7 @@ +@@ -75,10 +76,19 @@ backslash = grub_strchr (filepath, '\\'); } } @@ -21,27 +21,23 @@ Index: b/grub-core/kern/ieee1275/init.c void (*grub_ieee1275_net_config) (const char *dev, char **device, -@@ -82,10 +84,15 @@ + char **path); ++#ifdef __i386__ ++void ++grub_machine_get_bootlocation (char **device __attribute__ ((unused)), ++ char **path __attribute__ ((unused))) ++{ ++ grub_env_set ("prefix", "(sd,1)/"); ++} ++#else void grub_machine_get_bootlocation (char **device, char **path) { -+#ifndef __i386__ - char bootpath[64]; /* XXX check length */ - char *filename; - char *type; -+#endif - -+#ifdef __i386__ -+ grub_env_set ("prefix", "(sd,1)/"); -+#else - if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath, - sizeof (bootpath), 0)) - { -@@ -132,6 +139,7 @@ - *path = filename; +@@ -133,6 +143,7 @@ } } -+#endif } ++#endif /* Claim some available memory in the first /memory node. */ + #ifdef __sparc__ diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c index 54483db50..4f56e82f2 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -81,18 +81,21 @@ grub_translate_ieee1275_path (char *filepath) void (*grub_ieee1275_net_config) (const char *dev, char **device, char **path); +#ifdef __i386__ +void +grub_machine_get_bootlocation (char **device __attribute__ ((unused)), + char **path __attribute__ ((unused))) +{ + grub_env_set ("prefix", "(sd,1)/"); +} +#else void grub_machine_get_bootlocation (char **device, char **path) { -#ifndef __i386__ char bootpath[64]; /* XXX check length */ char *filename; char *type; -#endif -#ifdef __i386__ - grub_env_set ("prefix", "(sd,1)/"); -#else if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath, sizeof (bootpath), 0)) { @@ -139,8 +142,8 @@ grub_machine_get_bootlocation (char **device, char **path) *path = filename; } } -#endif } +#endif /* Claim some available memory in the first /memory node. */ #ifdef __sparc__