diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-01-24 15:34:47 -0500 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-01-24 15:34:47 -0500 |
commit | 0a0fc0ddbe732779366ab6b1b879f62195e65967 (patch) | |
tree | 7b42490a676cf39ae0691b6859ecf7fd410f229b /fs/9p/debug.h | |
parent | 4d5dbd0945d9e0833dd7964a3d6ee33157f7cc7a (diff) | |
parent | 3ee68c4af3fd7228c1be63254b9f884614f9ebb2 (diff) |
Merge with /home/shaggy/git/linus-clean/
Diffstat (limited to 'fs/9p/debug.h')
-rw-r--r-- | fs/9p/debug.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/9p/debug.h b/fs/9p/debug.h index 4445f06919d9..fe551032788b 100644 --- a/fs/9p/debug.h +++ b/fs/9p/debug.h | |||
@@ -51,16 +51,23 @@ do { \ | |||
51 | #if DEBUG_DUMP_PKT | 51 | #if DEBUG_DUMP_PKT |
52 | static inline void dump_data(const unsigned char *data, unsigned int datalen) | 52 | static inline void dump_data(const unsigned char *data, unsigned int datalen) |
53 | { | 53 | { |
54 | int i, j; | 54 | int i, n; |
55 | int len = datalen; | 55 | char buf[5*8]; |
56 | 56 | ||
57 | printk(KERN_DEBUG "data "); | 57 | n = 0; |
58 | for (i = 0; i < len; i += 4) { | 58 | i = 0; |
59 | for (j = 0; (j < 4) && (i + j < len); j++) | 59 | while (i < datalen) { |
60 | printk(KERN_DEBUG "%02x", data[i + j]); | 60 | n += snprintf(buf+n, sizeof(buf)-n, "%02x", data[i++]); |
61 | printk(KERN_DEBUG " "); | 61 | if (i%4 == 0) |
62 | n += snprintf(buf+n, sizeof(buf)-n, " "); | ||
63 | |||
64 | if (i%16 == 0) { | ||
65 | dprintk(DEBUG_ERROR, "%s\n", buf); | ||
66 | n = 0; | ||
67 | } | ||
62 | } | 68 | } |
63 | printk(KERN_DEBUG "\n"); | 69 | |
70 | dprintk(DEBUG_ERROR, "%s\n", buf); | ||
64 | } | 71 | } |
65 | #else /* DEBUG_DUMP_PKT */ | 72 | #else /* DEBUG_DUMP_PKT */ |
66 | static inline void dump_data(const unsigned char *data, unsigned int datalen) | 73 | static inline void dump_data(const unsigned char *data, unsigned int datalen) |