[OpenBIOS] [commit] r882 - in trunk/openbios-devel: arch/sparc64 drivers packages

repository service svn at openbios.org
Sun Oct 3 18:37:48 CEST 2010


Author: blueswirl
Date: Sun Oct  3 18:37:47 2010
New Revision: 882
URL: http://tracker.coreboot.org/trac/openbios/changeset/882

Log:
Fix warnings from GCC 4.6.0

Compiling Sparc64 with GCC 4.6.0 20100925 produced a few warnings:
../arch/sparc64/context.c: In function 'start_main':
../arch/sparc64/context.c:49:9: error: variable 'retval' set but not used [-Werror=unused-but-set-variable]
../packages/disk-label.c: In function 'dlabel_load':
../packages/disk-label.c:183:8: error: variable 'buf' set but not used [-Werror=unused-but-set-variable]
../drivers/floppy.c: In function 'collect_interrupt':
../drivers/floppy.c:378:13: error: variable 'status' set but not used [-Werror=unused-but-set-variable]

Fix the warnings by avoiding write-only variables.

Signed-off-by: Blue Swirl <blauwirbel at gmail.com>

Modified:
   trunk/openbios-devel/arch/sparc64/context.c
   trunk/openbios-devel/drivers/floppy.c
   trunk/openbios-devel/packages/disk-label.c

Modified: trunk/openbios-devel/arch/sparc64/context.c
==============================================================================
--- trunk/openbios-devel/arch/sparc64/context.c	Sun Oct  3 16:28:12 2010	(r881)
+++ trunk/openbios-devel/arch/sparc64/context.c	Sun Oct  3 18:37:47 2010	(r882)
@@ -46,17 +46,12 @@
  */
 static void start_main(void)
 {
-    int retval;
-
     /* Save startup context, so we can refer to it later.
      * We have to keep it in physical address since we will relocate. */
     __boot_ctx = virt_to_phys(__context);
 
     /* Start the real fun */
-    retval = openbios();
-
-    /* Pass return value to startup context. Bootloader may see it. */
-    //boot_ctx->eax = retval;
+    openbios();
 
     /* Returning from here should jump to __exit_context */
     __context = boot_ctx;

Modified: trunk/openbios-devel/drivers/floppy.c
==============================================================================
--- trunk/openbios-devel/drivers/floppy.c	Sun Oct  3 16:28:12 2010	(r881)
+++ trunk/openbios-devel/drivers/floppy.c	Sun Oct  3 18:37:47 2010	(r882)
@@ -375,7 +375,10 @@
 {
 	unsigned char pcn = 0xff;
 	unsigned char reply_buffer[MAX_REPLIES];
-	int nr, i, status;
+        int nr;
+#ifdef CONFIG_DEBUG_FLOPPY
+        int i, status;
+#endif
 	nr = result(reply_buffer, MAX_REPLIES);
 	if (nr != 0) {
 		printk_debug("SENSEI\n");
@@ -393,6 +396,7 @@
 			}
                         max_sensei--;
 		}while(((reply_buffer[0] & 0x83) != FD_DRIVE) && (nr == 2) && max_sensei);
+#ifdef CONFIG_DEBUG_FLOPPY
                 status = fdc_state.fdc_inb(FD_STATUS);
 		printk_debug("status = %x, reply_buffer=", status);
 		for(i = 0; i < nr; i++) {
@@ -400,6 +404,9 @@
 				reply_buffer[i]);
 		}
 		printk_debug("\n");
+#else
+                fdc_state.fdc_inb(FD_STATUS);
+#endif
 	}
 
 	return pcn;

Modified: trunk/openbios-devel/packages/disk-label.c
==============================================================================
--- trunk/openbios-devel/packages/disk-label.c	Sun Oct  3 16:28:12 2010	(r881)
+++ trunk/openbios-devel/packages/disk-label.c	Sun Oct  3 18:37:47 2010	(r882)
@@ -180,10 +180,16 @@
 dlabel_load( __attribute__((unused)) dlabel_info_t *di )
 {
 	/* Try the load method of the part package */
+#ifdef DEBUG_DISK_LABEL
 	char *buf;
+#endif
 	xt_t xt;
 
+#ifdef DEBUG_DISK_LABEL
 	buf = (char *)POP();
+#else
+        POP();
+#endif
 
 	DPRINTF("load invoked with address %p\n", buf);
 



More information about the OpenBIOS mailing list