Commit 6c1e5978 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Cyrill Gorcunov

hex_dump(): fix address printing

 - Fix printing the same address on every line (ie p+i, not p).
 - Use GNU %p to print pointer, to avoid messing with width etc.
   Side effect: 0x is added, hope that's ok.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent a9ba9732
......@@ -55,8 +55,8 @@ void hex_dump(void *addr, unsigned long len)
len = (len + 8) & ~7;
for (i = 0; i < len; i += 8) {
printk("%08lx: %02x %02x %02x %02x %02x %02x %02x %02x\n",
(long)p, p[i+0], p[i+1], p[i+2], p[i+3],
printk("%p: %02x %02x %02x %02x %02x %02x %02x %02x\n",
&p[i], p[i+0], p[i+1], p[i+2], p[i+3],
p[i+4], p[i+5], p[i+6], p[i+7]);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment