Skip to contentSkip to conversation

fix sn_serial warning

PATCH New Jesse Barnes 1 participant 1 message Mar 29, 2004 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix sn_serial warning

In my fixes to quiet the sn_serial driver, I made sn_debug_printf only get used when the DEBUG define was turned on in the driver but forgot to #ifdef out the function definition, causing an 'defined but not used' warning. This patch fixes that.

Jesse

===== drivers/char/sn_serial.c 1.10 vs edited =====

drivers/char/sn_serial.c +3 -1
@@ -82,10 +82,10 @@
 static unsigned long sn_interrupt_timeout;
 
 extern u64 master_node_bedrock_address;
-static int sn_debug_printf(const char *fmt, ...);
 
 #undef DEBUG
 #ifdef DEBUG
+static int sn_debug_printf(const char *fmt, ...);
 #define DPRINTF(x...) sn_debug_printf(x)
 #else
 #define DPRINTF(x...) do { } while (0)
@@ -247,6 +247,7 @@
 	sn_func->sal_puts(s, count);
 }
 
+#ifdef DEBUG
 /* this is as "close to the metal" as we can get, used when the driver
  * itself may be broken */
 static int
@@ -262,6 +263,7 @@
 	va_end(args);
 	return printed_len;
 }
+#endif /* DEBUG */
 
 /*
  * Interrupt handling routines.