Skip to contentSkip to conversation

PowerPC: Removed duplicate query..

PATCH New Vesa Jääskeläinen 1 participant 1 message Apr 27, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PowerPC: Removed duplicate query..

Hi,

I was looking at PowerPC's kernel code at one point and noticed that "/chosen" is queried multiple times. This message contains attachment removing this duplication.

Thanks,
Vesa Jääskeläinen

Index: ChangeLog
===================================================================
RCS file: /sources/grub/grub2/ChangeLog,v
retrieving revision 1.248

ChangeLog +5 -0
diff -u -r1.248 ChangeLog
@@ -1,3 +1,8 @@
+2006-04-27  Vesa Jaaskelainen  <[email protected]>
+
+	* kern/powerpc/ieee1275/init.c (grub_machine_init): Removed
+	duplicated query for IEEE-1275's "/chosen".
+
 2006-04-26  Yoshinori K. Okuji  <[email protected]>
 
 	* util/i386/pc/grub-mkimage.c (compress_kernel): Cast arguments

Index: kern/powerpc/ieee1275/init.c
===================================================================
RCS file: /sources/grub/grub2/kern/powerpc/ieee1275/init.c,v retrieving revision 1.25

powerpc/ieee1275/init.c +1 -3
diff -u -r1.25 init.c
@@ -116,7 +116,6 @@
 grub_machine_init (void)
 {
   char args[256];
-  grub_ieee1275_phandle_t chosen;
   int actual;
   extern char _start;
 
@@ -137,8 +136,7 @@
   grub_ofdisk_init ();
 
   /* Process commandline.  */
-  grub_ieee1275_finddevice ("/chosen", &chosen);
-  if (grub_ieee1275_get_property (chosen, "bootargs", &args,
+  if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootargs", &args,
 				  sizeof args, &actual) == 0
       && actual > 1)
     {