Skip to contentSkip to conversation

smsc9194: Remove uncompilable #if 0'd use of pr_dbg

PATCH Applied Joe Perches 2 participants 2 messages Aug 26, 2015 – Aug 27, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 smsc9194: Remove uncompilable #if 0'd use of pr_dbg

No pr_dbg method exists.

While this code is #if 0'd, it'd be nicer to use the generic hex_dump, so use it instead.

---

<snorts> no print_hex_dump_dbg method exists either.

V2: Change the uncompilable print_hex_dump_dbg call to
print_hex_dump_debug that actually could be compiled...

Or maybe just delete the driver altogether.

It'd probably be nice to one day create something like drivers/net/ethernet/obsolete and eventually kill off code for the stuff that hasn't been supported or sold in the last 20 years.

 drivers/net/ethernet/smsc/smc9194.c | 32 ++------------------------------
 1 file changed, 2 insertions(+), 30 deletions(-)
drivers/net/ethernet/smsc/smc9194.c +2 -30
index 67d9fde..94857c1 100644
@@ -1031,36 +1031,8 @@ err_out:
 static void print_packet( byte * buf, int length )
 {
 #if 0
-	int i;
-	int remainder;
-	int lines;
-
-	pr_dbg("Packet of length %d\n", length);
-	lines = length / 16;
-	remainder = length % 16;
-
-	for ( i = 0; i < lines ; i ++ ) {
-		int cur;
-
-		printk(KERN_DEBUG);
-		for ( cur = 0; cur < 8; cur ++ ) {
-			byte a, b;
-
-			a = *(buf ++ );
-			b = *(buf ++ );
-			pr_cont("%02x%02x ", a, b);
-		}
-		pr_cont("\n");
-	}
-	printk(KERN_DEBUG);
-	for ( i = 0; i < remainder/2 ; i++ ) {
-		byte a, b;
-
-		a = *(buf ++ );
-		b = *(buf ++ );
-		pr_cont("%02x%02x ", a, b);
-	}
-	pr_cont("\n");
+	print_hex_dump_debug(DRV_NAME, DUMP_PREFIX_OFFSET, 16, 1,
+			     buf, length, true);
 #endif
 }
 #endif
maintainer Applied
#1 lore raw

From: Joe Perches <[email protected]>
Date: Wed, 26 Aug 2015 11:49:35 -0700

Quoted 6 lines

No pr_dbg method exists.

While this code is #if 0'd, it'd be nicer to
use the generic hex_dump, so use it instead.

Applied to net-next, thanks Joe.

I don't know what to do with "really old" drivers. People still use them, some via qemu or whatever.

But yeah this particular case is likely unused by anyone.