mtd: nftl: use %*ph to print small buffer
PATCH 1/1 mtd: nftl: use %*ph to print small buffer
Use %*ph format to print small buffer as hex string.
Suggested-by Andy Shevchenko <[email protected]>
Signed-off-by Antonio Cardace <[email protected]>
---
What about this one?
drivers/mtd/nftlmount.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/nftlmount.c +1 -2
@@ -122,8 +122,7 @@ static int find_boot_record(struct NFTLrecord *nftl)if (memcmp (buf,"ANAND" ,6 )) {printk (KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but went away on reread!\n" , block * nftl->EraseSize, nftl->mbd.mtd->index); -printk (KERN_NOTICE "New data are: %02x %02x %02x %02x %02x %02x\n" , - buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ], buf[5 ]); +printk (KERN_NOTICE "New data are: %6ph\n" , buf);continue ; }#endif
Signature · 1 line
2.15.1.354.g95ec6b1b3
Quoted 2 lines · Antonio Cardace
Use %*ph format to print small buffer as hex string.
Any comments so far?
Quoted 27 lines
Suggested-by Andy Shevchenko <[email protected]>Signed-off-by Antonio Cardace <[email protected]>---
drivers/mtd/nftlmount.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mtd/nftlmount.c +0
-2@@ -122,8 +122,7 @@ static int find_boot_record(struct NFTLrecord *nftl)if (memcmp (buf,"ANAND" ,6 )) { printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but went away on reread!\n", block * nftl->EraseSize, nftl- >mbd.mtd->index); - printk(KERN_NOTICE "New data are: %02x %02x %02x %02x %02x %02x\n", - buf[0], buf[1], buf[2], buf[3],buf[4], buf[5]);
drivers/mtd/nftlmount.c +1
-0+ printk(KERN_NOTICE "New data are: %6ph\n",buf);
drivers/mtd/nftlmount.c +0
-0continue; }#endif
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Boris Brezillon
AppliedQuoted 1 line · On Tue, 13 Feb 2018 17:52:45 +0000 Antonio Cardace <[email protected]>…
Use %*ph format to print small buffer as hex string.
Applied.
Thanks,
Boris
Quoted 23 lines
Suggested-by Andy Shevchenko <[email protected]>Signed-off-by Antonio Cardace <[email protected]>---
What about this one?drivers/mtd/nftlmount.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/mtd/nftlmount.c +1
-2@@ -122,8 +122,7 @@ static int find_boot_record(struct NFTLrecord *nftl)if (memcmp (buf,"ANAND" ,6 )) {printk (KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but went away on reread!\n" , block * nftl->EraseSize, nftl->mbd.mtd->index); -printk (KERN_NOTICE "New data are: %02x %02x %02x %02x %02x %02x\n" , - buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ], buf[5 ]); +printk (KERN_NOTICE "New data are: %6ph\n" , buf);continue ; }#endif
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com