[PATCH] mtd: nftl: use %*ph to print small buffer

Andy Shevchenko andriy.shevchenko at linux.intel.com
Fri Mar 16 07:20:30 PDT 2018


On Tue, 2018-02-13 at 17:52 +0000, Antonio Cardace wrote:
> Use %*ph format to print small buffer as hex string.
> 

Any comments so far?

> Suggested-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> Signed-off-by: Antonio Cardace <anto.cardace at gmail.com>
> ---
> 
>  drivers/mtd/nftlmount.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c
> index 184c8fbfe465..a8bdc1455b50 100644
> --- a/drivers/mtd/nftlmount.c
> +++ b/drivers/mtd/nftlmount.c
> @@ -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

-- 
Andy Shevchenko <andriy.shevchenko at linux.intel.com>
Intel Finland Oy



More information about the linux-mtd mailing list