mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 09:12:07 +00:00
hwmon: (sht21) Use %*ph to print small buffer
Use %*ph format to print small buffer as hex string. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Message-ID: <20240911194627.2885506-1-andriy.shevchenko@linux.intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
d22bd451d5
commit
38f9fa39af
@ -199,10 +199,7 @@ static ssize_t eic_read(struct sht21 *sht21)
|
|||||||
eic[6] = rx[0];
|
eic[6] = rx[0];
|
||||||
eic[7] = rx[1];
|
eic[7] = rx[1];
|
||||||
|
|
||||||
ret = snprintf(sht21->eic, sizeof(sht21->eic),
|
ret = snprintf(sht21->eic, sizeof(sht21->eic), "%8phN\n", eic);
|
||||||
"%02x%02x%02x%02x%02x%02x%02x%02x\n",
|
|
||||||
eic[0], eic[1], eic[2], eic[3],
|
|
||||||
eic[4], eic[5], eic[6], eic[7]);
|
|
||||||
out:
|
out:
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
sht21->eic[0] = 0;
|
sht21->eic[0] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user