lib/hexdump: Take const void * and size_t as arguments
Representing a memory location as an unsigned long is specific to 32-bit architectures. It also doesn't make sense to represent a length assumed to be positive as a signed integer. With this change, it is no longer necessary to cast a pointer to unsigned long when passing it to hexdump. Change-Id: I641777d940ceac6f37c363051f1e9c1b3ec3ed95 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/4575 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
@ -28,7 +28,7 @@ static int isprint(int c)
|
||||
return (c >= 32 && c <= 126);
|
||||
}
|
||||
|
||||
void hexdump(unsigned long memory, int length)
|
||||
void hexdump(const void* memory, size_t length)
|
||||
{
|
||||
int i;
|
||||
uint8_t *m;
|
||||
@ -48,7 +48,7 @@ void hexdump(unsigned long memory, int length)
|
||||
}
|
||||
|
||||
if (all_zero < 2) {
|
||||
printk(BIOS_DEBUG, "%08lx:", memory + i);
|
||||
printk(BIOS_DEBUG, "%p:", memory + i);
|
||||
for (j = 0; j < 16; j++)
|
||||
printk(BIOS_DEBUG, " %02x", m[i+j]);
|
||||
printk(BIOS_DEBUG, " ");
|
||||
|
Reference in New Issue
Block a user