mtd: st_spi_fsm: use %*ph to print small buffer

Message ID 20180212184130.10238-1-anto.cardace@gmail.com
State Accepted
Delegated to: Boris Brezillon
Headers show
Series
  • mtd: st_spi_fsm: use %*ph to print small buffer
Related show

Commit Message

Antonio Cardace Feb. 12, 2018, 6:41 p.m.
Use %*ph format to print small buffer as hex string.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Antonio Cardace <anto.cardace@gmail.com>
---
 drivers/mtd/devices/st_spi_fsm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Andy Shevchenko March 16, 2018, 2:20 p.m. | #1
On Mon, 2018-02-12 at 18:41 +0000, Antonio Cardace wrote:
> Use %*ph format to print small buffer as hex string.
> 

Any comments so far?

> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Antonio Cardace <anto.cardace@gmail.com>
> ---
>  drivers/mtd/devices/st_spi_fsm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/devices/st_spi_fsm.c
> b/drivers/mtd/devices/st_spi_fsm.c
> index 7bc29d725200..a33f5fd6818c 100644
> --- a/drivers/mtd/devices/st_spi_fsm.c
> +++ b/drivers/mtd/devices/st_spi_fsm.c
> @@ -1868,8 +1868,7 @@ static struct flash_info
> *stfsm_jedec_probe(struct stfsm *fsm)
>  	 */
>  	ext_jedec = id[3] << 8  | id[4];
>  
> -	dev_dbg(fsm->dev, "JEDEC =  0x%08x [%02x %02x %02x %02x
> %02x]\n",
> -		jedec, id[0], id[1], id[2], id[3], id[4]);
> +	dev_dbg(fsm->dev, "JEDEC =  0x%08x [%5ph]\n", jedec, id);
>  
>  	for (info = flash_types; info->name; info++) {
>  		if (info->jedec_id == jedec) {
Boris Brezillon March 18, 2018, 9:21 p.m. | #2
On Mon, 12 Feb 2018 18:41:30 +0000
Antonio Cardace <anto.cardace@gmail.com> wrote:

> Use %*ph format to print small buffer as hex string.

Applied.

Thanks,

Boris

> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Antonio Cardace <anto.cardace@gmail.com>
> ---
>  drivers/mtd/devices/st_spi_fsm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
> index 7bc29d725200..a33f5fd6818c 100644
> --- a/drivers/mtd/devices/st_spi_fsm.c
> +++ b/drivers/mtd/devices/st_spi_fsm.c
> @@ -1868,8 +1868,7 @@ static struct flash_info *stfsm_jedec_probe(struct stfsm *fsm)
>  	 */
>  	ext_jedec = id[3] << 8  | id[4];
>  
> -	dev_dbg(fsm->dev, "JEDEC =  0x%08x [%02x %02x %02x %02x %02x]\n",
> -		jedec, id[0], id[1], id[2], id[3], id[4]);
> +	dev_dbg(fsm->dev, "JEDEC =  0x%08x [%5ph]\n", jedec, id);
>  
>  	for (info = flash_types; info->name; info++) {
>  		if (info->jedec_id == jedec) {

Patch

diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index 7bc29d725200..a33f5fd6818c 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -1868,8 +1868,7 @@  static struct flash_info *stfsm_jedec_probe(struct stfsm *fsm)
 	 */
 	ext_jedec = id[3] << 8  | id[4];
 
-	dev_dbg(fsm->dev, "JEDEC =  0x%08x [%02x %02x %02x %02x %02x]\n",
-		jedec, id[0], id[1], id[2], id[3], id[4]);
+	dev_dbg(fsm->dev, "JEDEC =  0x%08x [%5ph]\n", jedec, id);
 
 	for (info = flash_types; info->name; info++) {
 		if (info->jedec_id == jedec) {