diff mbox series

[v1,1/1] hwmon: (sch5636) Print unknown ID in error string via %*pE

Message ID 20240911201903.2886874-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Headers show
Series [v1,1/1] hwmon: (sch5636) Print unknown ID in error string via %*pE | expand

Commit Message

Andy Shevchenko Sept. 11, 2024, 8:19 p.m. UTC
Instead of custom approach this allows to print escaped strings
via %*pE extension. With this the unknown ID will be printed
as a string. Nonetheless, leave hex values to be printed as well.

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

Comments

Guenter Roeck Sept. 12, 2024, 9:27 p.m. UTC | #1
On Wed, Sep 11, 2024 at 11:19:03PM +0300, Andy Shevchenko wrote:
> Instead of custom approach this allows to print escaped strings
> via %*pE extension. With this the unknown ID will be printed
> as a string. Nonetheless, leave hex values to be printed as well.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied.

Thanks,
Guenter
diff mbox series

Patch

diff --git a/drivers/hwmon/sch5636.c b/drivers/hwmon/sch5636.c
index 6e6d54158474..a4b05ebb0546 100644
--- a/drivers/hwmon/sch5636.c
+++ b/drivers/hwmon/sch5636.c
@@ -416,8 +416,7 @@  static int sch5636_probe(struct platform_device *pdev)
 	id[i] = '\0';
 
 	if (strcmp(id, "THS")) {
-		pr_err("Unknown Fujitsu id: %02x%02x%02x\n",
-		       id[0], id[1], id[2]);
+		pr_err("Unknown Fujitsu id: %3pE (%3ph)\n", id, id);
 		err = -ENODEV;
 		goto error;
 	}