diff mbox series

[v1] zd1211rw: use %*ph to print small buffer

Message ID 20190904175323.77984-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit d13b12c30c345a2cbc10b72eb05adbc188eb5a92
Delegated to: Kalle Valo
Headers show
Series [v1] zd1211rw: use %*ph to print small buffer | expand

Commit Message

Andy Shevchenko Sept. 4, 2019, 5:53 p.m. UTC
Use %*ph format to print small buffer as hex string.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/wireless/zydas/zd1211rw/zd_chip.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Kalle Valo Sept. 6, 2019, 2:15 p.m. UTC | #1
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Use %*ph format to print small buffer as hex string.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied to wireless-drivers-next.git, thanks.

d13b12c30c34 zd1211rw: use %*ph to print small buffer
diff mbox series

Patch

diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_chip.c b/drivers/net/wireless/zydas/zd1211rw/zd_chip.c
index 40c0a86dbfc7..0af4b1986e48 100644
--- a/drivers/net/wireless/zydas/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zydas/zd1211rw/zd_chip.c
@@ -41,8 +41,7 @@  void zd_chip_clear(struct zd_chip *chip)
 static int scnprint_mac_oui(struct zd_chip *chip, char *buffer, size_t size)
 {
 	u8 *addr = zd_mac_get_perm_addr(zd_chip_to_mac(chip));
-	return scnprintf(buffer, size, "%02x-%02x-%02x",
-		         addr[0], addr[1], addr[2]);
+	return scnprintf(buffer, size, "%3phD", addr);
 }
 
 /* Prints an identifier line, which will support debugging. */