]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] dvb_net: Convert local hex dump to print_hex_dump_debug
authorJoe Perches <joe@perches.com>
Wed, 28 Jan 2015 18:05:52 +0000 (15:05 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 3 Feb 2015 20:24:44 +0000 (18:24 -0200)
Use the generic facility instead of a home-grown one.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-core/dvb_net.c

index 0b0f97af65d271463d7cdd9dfbd3fb8ca5478fd8..686d3277dad123113d5464b1f00bb4e5b3d8b069 100644 (file)
@@ -83,33 +83,9 @@ static inline __u32 iov_crc32( __u32 c, struct kvec *iov, unsigned int cnt )
 
 #ifdef ULE_DEBUG
 
-#define isprint(c)     ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'))
-
-static void hexdump( const unsigned char *buf, unsigned short len )
+static void hexdump(const unsigned char *buf, unsigned short len)
 {
-       char str[80], octet[10];
-       int ofs, i, l;
-
-       for (ofs = 0; ofs < len; ofs += 16) {
-               sprintf( str, "%03d: ", ofs );
-
-               for (i = 0; i < 16; i++) {
-                       if ((i + ofs) < len)
-                               sprintf( octet, "%02x ", buf[ofs + i] );
-                       else
-                               strcpy( octet, "   " );
-
-                       strcat( str, octet );
-               }
-               strcat( str, "  " );
-               l = strlen( str );
-
-               for (i = 0; (i < 16) && ((i + ofs) < len); i++)
-                       str[l++] = isprint( buf[ofs + i] ) ? buf[ofs + i] : '.';
-
-               str[l] = '\0';
-               printk( KERN_WARNING "%s\n", str );
-       }
+       print_hex_dump_debug("", DUMP_PREFIX_OFFSET, 16, 1, buf, len, true);
 }
 
 #endif