diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-09-04 19:48:35 +0200 |
---|---|---|
committer | Kevin Hilman <khilman@baylibre.com> | 2019-10-03 17:43:33 +0200 |
commit | 9be579f4c41f69c42278980af73e3b201f4159bb (patch) | |
tree | b181a9543fc73b75cc96d1e90495c9cda721f8c2 /drivers/firmware | |
parent | firmware: meson_sm: Rework driver as a proper platform driver (diff) | |
download | linux-9be579f4c41f69c42278980af73e3b201f4159bb.tar.xz linux-9be579f4c41f69c42278980af73e3b201f4159bb.zip |
firmware: meson_sm: 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>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/meson/meson_sm.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c index 2e36a2aa274c..1d5b4d74f96d 100644 --- a/drivers/firmware/meson/meson_sm.c +++ b/drivers/firmware/meson/meson_sm.c @@ -256,19 +256,7 @@ static ssize_t serial_show(struct device *dev, struct device_attribute *attr, return ret; } - ret = sprintf(buf, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n", - id_buf[SM_CHIP_ID_OFFSET + 0], - id_buf[SM_CHIP_ID_OFFSET + 1], - id_buf[SM_CHIP_ID_OFFSET + 2], - id_buf[SM_CHIP_ID_OFFSET + 3], - id_buf[SM_CHIP_ID_OFFSET + 4], - id_buf[SM_CHIP_ID_OFFSET + 5], - id_buf[SM_CHIP_ID_OFFSET + 6], - id_buf[SM_CHIP_ID_OFFSET + 7], - id_buf[SM_CHIP_ID_OFFSET + 8], - id_buf[SM_CHIP_ID_OFFSET + 9], - id_buf[SM_CHIP_ID_OFFSET + 10], - id_buf[SM_CHIP_ID_OFFSET + 11]); + ret = sprintf(buf, "%12phN\n", &id_buf[SM_CHIP_ID_OFFSET]); kfree(id_buf); |