Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: typec: ucsi: Use %pe to print error pointers
@ 2026-07-09  2:43 Subasri S
  2026-07-13  9:09 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: Subasri S @ 2026-07-09  2:43 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Subasri S

Use the %pe format specifier instead of %ld with PTR_ERR() for printing
error pointers in ucsi_register_plug(), ucsi_register_cable(), and
ucsi_register_partner(). This prints symbolic error names (e.g.
-ENOMEM) instead of errno numbers (e.g. -12), making debug logs more
readable.

This patch fixes coccinelle reported warnings:
./typec/ucsi/ucsi.c:1026:3-10: WARNING: Consider using %pe to print PTR_ERR()
./typec/ucsi/ucsi.c:1156:3-10: WARNING: Consider using %pe to print PTR_ERR()
./typec/ucsi/ucsi.c:967:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Subasri S <subasris1210@gmail.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 92166a3725b1..bf896e5cefc3 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -963,8 +963,8 @@ static int ucsi_register_plug(struct ucsi_connector *con)
 	plug = typec_register_plug(con->cable, &desc);
 	if (IS_ERR(plug)) {
 		dev_err(con->ucsi->dev,
-			"con%d: failed to register plug (%ld)\n", con->num,
-			PTR_ERR(plug));
+			"con%d: failed to register plug (%pe)\n", con->num,
+			plug);
 		return PTR_ERR(plug);
 	}
 
@@ -1022,8 +1022,8 @@ static int ucsi_register_cable(struct ucsi_connector *con)
 	cable = typec_register_cable(con->port, &desc);
 	if (IS_ERR(cable)) {
 		dev_err(con->ucsi->dev,
-			"con%d: failed to register cable (%ld)\n", con->num,
-			PTR_ERR(cable));
+			"con%d: failed to register cable (%pe)\n", con->num,
+			cable);
 		return PTR_ERR(cable);
 	}
 
@@ -1152,8 +1152,8 @@ static int ucsi_register_partner(struct ucsi_connector *con)
 	partner = typec_register_partner(con->port, &desc);
 	if (IS_ERR(partner)) {
 		dev_err(con->ucsi->dev,
-			"con%d: failed to register partner (%ld)\n", con->num,
-			PTR_ERR(partner));
+			"con%d: failed to register partner (%pe)\n", con->num,
+			partner);
 		return PTR_ERR(partner);
 	}
 

---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260708-subasri-usb-ucsi-v1-34dde97e0b61

Best regards,
-- 
Subasri S <subasris1210@gmail.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-13  9:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09  2:43 [PATCH] usb: typec: ucsi: Use %pe to print error pointers Subasri S
2026-07-13  9:09 ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox