Skip to contentSkip to conversation

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

PATCH Applied Antonio Cardace 3 participants 3 messages Feb 12, 2018 – Mar 18, 2018 Memory technology devices (MTD)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: st_spi_fsm: use %*ph to print small buffer

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

---
 drivers/mtd/devices/st_spi_fsm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/devices/st_spi_fsm.c +1 -2
index 7bc29d725200..a33f5fd6818c 100644
@@ -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) {
Signature · 1 line
2.15.1.354.g95ec6b1b3
#1 lore raw
Quoted 2 lines · Antonio Cardace

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

Any comments so far?

Quoted 23 lines
---
 drivers/mtd/devices/st_spi_fsm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/devices/st_spi_fsm.c +1 -2
index 7bc29d725200..a33f5fd6818c 100644
@@ -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);
 
drivers/mtd/devices/st_spi_fsm.c +0 -0
 	for (info = flash_types; info->name; info++) {
 		if (info->jedec_id == jedec) {
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#2 lore raw
In reply to Antonio Cardace
Quoted 1 line · On Mon, 12 Feb 2018 18:41:30 +0000 Antonio Cardace <[email protected]>…

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

Applied.

Thanks,

Boris

Quoted 21 lines
---
 drivers/mtd/devices/st_spi_fsm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/devices/st_spi_fsm.c +1 -2
index 7bc29d725200..a33f5fd6818c 100644
@@ -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) {
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com