diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-10-01 08:17:25 -0400 |
---|---|---|
committer | Jesper Nilsson <jespern@axis.com> | 2015-11-02 14:03:05 -0500 |
commit | fad5a06b0cfd9a65c71d09c70520d0cf67e0c577 (patch) | |
tree | 08c08e366302bdc8ea047f9891cc783b342f058c /arch/cris/arch-v32 | |
parent | ab28e96fd1cf1db1579854931890e5613efc5021 (diff) |
cris: re-use helpers to dump data in hex format
There are native helpers such as print_hex_byte() and %*ph specifier to dump
data in hex format. Re-use them instead of a custom approach.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jesper Nilsson <jespern@axis.com>
Diffstat (limited to 'arch/cris/arch-v32')
-rw-r--r-- | arch/cris/arch-v32/drivers/axisflashmap.c | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/arch/cris/arch-v32/drivers/axisflashmap.c b/arch/cris/arch-v32/drivers/axisflashmap.c index 5387424683cc..c6309a182f46 100644 --- a/arch/cris/arch-v32/drivers/axisflashmap.c +++ b/arch/cris/arch-v32/drivers/axisflashmap.c | |||
@@ -361,7 +361,7 @@ static int __init init_axis_flash(void) | |||
361 | 361 | ||
362 | #if 0 /* Dump flash memory so we can see what is going on */ | 362 | #if 0 /* Dump flash memory so we can see what is going on */ |
363 | if (main_mtd) { | 363 | if (main_mtd) { |
364 | int sectoraddr, i; | 364 | int sectoraddr; |
365 | for (sectoraddr = 0; sectoraddr < 2*65536+4096; | 365 | for (sectoraddr = 0; sectoraddr < 2*65536+4096; |
366 | sectoraddr += PAGESIZE) { | 366 | sectoraddr += PAGESIZE) { |
367 | main_mtd->read(main_mtd, sectoraddr, PAGESIZE, &len, | 367 | main_mtd->read(main_mtd, sectoraddr, PAGESIZE, &len, |
@@ -369,21 +369,7 @@ static int __init init_axis_flash(void) | |||
369 | printk(KERN_INFO | 369 | printk(KERN_INFO |
370 | "Sector at %d (length %d):\n", | 370 | "Sector at %d (length %d):\n", |
371 | sectoraddr, len); | 371 | sectoraddr, len); |
372 | for (i = 0; i < PAGESIZE; i += 16) { | 372 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1, page, PAGESIZE, false); |
373 | printk(KERN_INFO | ||
374 | "%02x %02x %02x %02x " | ||
375 | "%02x %02x %02x %02x " | ||
376 | "%02x %02x %02x %02x " | ||
377 | "%02x %02x %02x %02x\n", | ||
378 | page[i] & 255, page[i+1] & 255, | ||
379 | page[i+2] & 255, page[i+3] & 255, | ||
380 | page[i+4] & 255, page[i+5] & 255, | ||
381 | page[i+6] & 255, page[i+7] & 255, | ||
382 | page[i+8] & 255, page[i+9] & 255, | ||
383 | page[i+10] & 255, page[i+11] & 255, | ||
384 | page[i+12] & 255, page[i+13] & 255, | ||
385 | page[i+14] & 255, page[i+15] & 255); | ||
386 | } | ||
387 | } | 373 | } |
388 | } | 374 | } |
389 | #endif | 375 | #endif |
@@ -417,25 +403,11 @@ static int __init init_axis_flash(void) | |||
417 | 403 | ||
418 | #if 0 /* Dump partition table so we can see what is going on */ | 404 | #if 0 /* Dump partition table so we can see what is going on */ |
419 | printk(KERN_INFO | 405 | printk(KERN_INFO |
420 | "axisflashmap: flash read %d bytes at 0x%08x, data: " | 406 | "axisflashmap: flash read %d bytes at 0x%08x, data: %8ph\n", |
421 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", | 407 | len, CONFIG_ETRAX_PTABLE_SECTOR, page); |
422 | len, CONFIG_ETRAX_PTABLE_SECTOR, | ||
423 | page[0] & 255, page[1] & 255, | ||
424 | page[2] & 255, page[3] & 255, | ||
425 | page[4] & 255, page[5] & 255, | ||
426 | page[6] & 255, page[7] & 255); | ||
427 | printk(KERN_INFO | 408 | printk(KERN_INFO |
428 | "axisflashmap: partition table offset %d, data: " | 409 | "axisflashmap: partition table offset %d, data: %8ph\n", |
429 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", | 410 | PARTITION_TABLE_OFFSET, page + PARTITION_TABLE_OFFSET); |
430 | PARTITION_TABLE_OFFSET, | ||
431 | page[PARTITION_TABLE_OFFSET+0] & 255, | ||
432 | page[PARTITION_TABLE_OFFSET+1] & 255, | ||
433 | page[PARTITION_TABLE_OFFSET+2] & 255, | ||
434 | page[PARTITION_TABLE_OFFSET+3] & 255, | ||
435 | page[PARTITION_TABLE_OFFSET+4] & 255, | ||
436 | page[PARTITION_TABLE_OFFSET+5] & 255, | ||
437 | page[PARTITION_TABLE_OFFSET+6] & 255, | ||
438 | page[PARTITION_TABLE_OFFSET+7] & 255); | ||
439 | #endif | 411 | #endif |
440 | } | 412 | } |
441 | 413 | ||