Skip to content

Commit 38f9fa3

Browse files
andy-shevgroeck
authored andcommitted
hwmon: (sht21) Use %*ph to print small buffer
Use %*ph format to print small buffer as hex string. Signed-off-by: Andy Shevchenko <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
1 parent d22bd45 commit 38f9fa3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/hwmon/sht21.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,7 @@ static ssize_t eic_read(struct sht21 *sht21)
199199
eic[6] = rx[0];
200200
eic[7] = rx[1];
201201

202-
ret = snprintf(sht21->eic, sizeof(sht21->eic),
203-
"%02x%02x%02x%02x%02x%02x%02x%02x\n",
204-
eic[0], eic[1], eic[2], eic[3],
205-
eic[4], eic[5], eic[6], eic[7]);
202+
ret = snprintf(sht21->eic, sizeof(sht21->eic), "%8phN\n", eic);
206203
out:
207204
if (ret < 0)
208205
sht21->eic[0] = 0;

0 commit comments

Comments
 (0)