[PATCH 011/510] beceem: use kernel print_hex_dump function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Stephen Hemminger <stephen.hemminger@xxxxxxxxxx>

No longer need special hex dump routine

Signed-off-by: Stephen Hemminger <shemminger@xxxxxxxxxx>
---
 drivers/staging/bcm/Debug.c  |   39 ---------------------------------------
 drivers/staging/bcm/Debug.h  |   25 +++++++------------------
 drivers/staging/bcm/Makefile |    2 +-
 3 files changed, 8 insertions(+), 58 deletions(-)
 delete mode 100644 drivers/staging/bcm/Debug.c

diff --git a/drivers/staging/bcm/Debug.c b/drivers/staging/bcm/Debug.c
deleted file mode 100644
index b86d845..0000000
--- a/drivers/staging/bcm/Debug.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "headers.h"
-
-void bcm_print_buffer(UINT debug_level, const char *function_name,
-		      const char *file_name, int line_number,
-		      const unsigned char *buffer, int bufferlen,
-		      BASE_TYPE base)
-{
-	int i;
-	static const char * const buff_dump_base[] = {
-		"DEC", "HEX", "OCT", "BIN"
-	};
-
-	if(debug_level < BCM_SCREAM)
-		return;
-
-	printk("\n" KERN_DEBUG "%s:%s:%d:Buffer dump of size 0x%x in the %s:\n",
-	       file_name, function_name, line_number, bufferlen, buff_dump_base[1]);
-
-	for(i = 0; i < bufferlen;i++) {
-		if(i && !(i%16) )
-			printk("\n");
-		switch(base) {
-		case BCM_BASE_TYPE_DEC:
-			printk("%03d ", buffer[i]);
-			break;
-		case BCM_BASE_TYPE_OCT:
-			printk("%0x03o ", buffer[i]);
-			break;
-		case BCM_BASE_TYPE_BIN:
-			printk("%02x ", buffer[i]);
-			break;
-		case BCM_BASE_TYPE_HEX:
-		default:
-			printk("%02X ", buffer[i]);
-			break;
-		}
-		printk("\n");
-	}
-}
diff --git a/drivers/staging/bcm/Debug.h b/drivers/staging/bcm/Debug.h
index 58e46a6..3138729 100644
--- a/drivers/staging/bcm/Debug.h
+++ b/drivers/staging/bcm/Debug.h
@@ -9,19 +9,6 @@
 #include <linux/string.h>
 #define NONE 0xFFFF
 
-typedef enum _BASE_TYPE
-{
-	BCM_BASE_TYPE_DEC,
-	BCM_BASE_TYPE_OCT,
-	BCM_BASE_TYPE_BIN,
-	BCM_BASE_TYPE_HEX,
-	BCM_BASE_TYPE_NONE,
-} BASE_TYPE, *PBASE_TYPE;
-
-void bcm_print_buffer(UINT debug_level, const char *function_name,
-		      const char *file_name, int line_number,
-		      const unsigned char *buffer, int bufferlen, BASE_TYPE base);
-
 
 //--------------------------------------------------------------------------------
 
@@ -231,7 +218,7 @@ typedef struct _S_BCM_DEBUG_STATE {
 #define BCM_DEBUG_PRINT(Adapter, Type, SubType, dbg_level, string, args...) \
 	do {								\
 		if (DBG_TYPE_PRINTK == Type)				\
-			pr_info("%s:" string "\n", __func__, ##args);	\
+			pr_info("%s:" string, __func__, ##args);	\
 		else if (Adapter &&					\
 			 (dbg_level & DBG_LVL_BITMASK) <= Adapter->stDebugState.debug_level && \
 			 (Type & Adapter->stDebugState.type) &&		\
@@ -239,7 +226,7 @@ typedef struct _S_BCM_DEBUG_STATE {
 			if (dbg_level & DBG_NO_FUNC_PRINT)		\
 				printk(KERN_DEBUG string, ##args);	\
 			else						\
-				printk(KERN_DEBUG "%s:" string "\n", __func__, ##args);	\
+				printk(KERN_DEBUG "%s:" string, __func__, ##args);	\
 		}							\
 	} while (0)
 
@@ -248,9 +235,11 @@ typedef struct _S_BCM_DEBUG_STATE {
 	    (Adapter &&							\
 	     (dbg_level & DBG_LVL_BITMASK) <= Adapter->stDebugState.debug_level  && \
 	     (Type & Adapter->stDebugState.type) &&			\
-	     (SubType & Adapter->stDebugState.subtype[Type])))		\
-		bcm_print_buffer(dbg_level, __func__, __FILE__, __LINE__, \
-				 buffer, bufferlen, BCM_BASE_TYPE_HEX);	\
+	     (SubType & Adapter->stDebugState.subtype[Type]))) {	\
+		printk(KERN_DEBUG "%s:\n", __func__);			\
+		print_hex_dump(KERN_DEBUG, " ", DUMP_PREFIX_OFFSET,	\
+			       16, 1, buffer, bufferlen, false);	\
+	}								\
 } while(0)
 
 
diff --git a/drivers/staging/bcm/Makefile b/drivers/staging/bcm/Makefile
index c3ae25a..6f6fcee 100644
--- a/drivers/staging/bcm/Makefile
+++ b/drivers/staging/bcm/Makefile
@@ -6,7 +6,7 @@ obj-$(CONFIG_BCM_WIMAX) +=	bcm_wimax.o
 
 bcm_wimax-y :=  InterfaceDld.o InterfaceIdleMode.o InterfaceInit.o InterfaceRx.o \
 		InterfaceIsr.o InterfaceMisc.o InterfaceTx.o \
-		Arp.o CmHost.o Debug.o IPv6Protocol.o Qos.o Transmit.o\
+		Arp.o CmHost.o IPv6Protocol.o Qos.o Transmit.o\
 		Bcmnet.o DDRInit.o HandleControlPacket.o\
 		LeakyBucket.o Misc.o sort.o Bcmchar.o hostmibs.o PHSModule.o\
 	 	Osal_Misc.o led_control.o nvm.o vendorspecificextn.o
-- 
1.7.3.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux