Skip to contentSkip to conversation

zd1211rw: use %*ph to print small buffer

PATCH In review Andy Shevchenko 2 participants 2 messages Sep 4, 2019 – Sep 6, 2019 ZD1211RW wireless driver

lore
Share & tools
lore
#0 lore raw

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

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

---
 drivers/net/wireless/zydas/zd1211rw/zd_chip.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/zydas/zd1211rw/zd_chip.c +1 -2
index 40c0a86dbfc7..0af4b1986e48 100644
@@ -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. */
Signature · 1 line
2.23.0.rc1
#1 lore raw
Quoted 3 lines · Andy Shevchenko

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

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

d13b12c30c34 zd1211rw: use %*ph to print small buffer

Signature · 3 lines
https://patchwork.kernel.org/patch/11131201/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches