Skip to contentSkip to conversation

hwmon: (sch5636) Print unknown ID in error string via %*pE

PATCH Applied Andy Shevchenko 2 participants 2 messages Sep 11, 2024 – Sep 12, 2024 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (sch5636) Print unknown ID in error string via %*pE

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.

---
 drivers/hwmon/sch5636.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hwmon/sch5636.c +1 -2
index 6e6d54158474..a4b05ebb0546 100644
@@ -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;
 	}
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
maintainer Applied
#1 lore raw
Quoted 5 lines · Andy Shevchenko

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.

Applied.

Thanks,
Guenter