mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: use %pe to print PTR_ERR in fw-core.c
       [not found] <20260315-greybus-pe-format-v1-1-d923fbed3097.ref@yahoo.pl>
@ 2026-03-15  8:40 ` Tomasz Unger
  2026-03-15 17:45   ` Ethan Tidmore
  2026-03-16  8:44   ` Johan Hovold
  0 siblings, 2 replies; 3+ messages in thread
From: Tomasz Unger @ 2026-03-15  8:40 UTC (permalink / raw)
  To: Viresh Kumar, Johan Hovold, Alex Elder, Greg Kroah-Hartman
  Cc: greybus-dev, linux-staging, linux-kernel, Tomasz Unger

Replace PTR_ERR() with %pe format specifier which directly prints
the error pointer in a human readable way, making the code cleaner
and more idiomatic.

Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
Verified with checkpatch.pl - no errors or warnings.
Compiled the gb-firmware module successfully.
Module compiles and loads in a QEMU environment.
---
 drivers/staging/greybus/fw-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/greybus/fw-core.c b/drivers/staging/greybus/fw-core.c
index 2016a74f137f..7053afa9ab3e 100644
--- a/drivers/staging/greybus/fw-core.c
+++ b/drivers/staging/greybus/fw-core.c
@@ -112,8 +112,8 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
 			connection = gb_connection_create(bundle, cport_id,
 							  gb_fw_download_request_handler);
 			if (IS_ERR(connection)) {
-				dev_err(&bundle->dev, "failed to create download connection (%ld)\n",
-					PTR_ERR(connection));
+				dev_err(&bundle->dev, "failed to create download connection (%pe)\n",
+					connection);
 			} else {
 				fw_core->download_connection = connection;
 			}
@@ -131,8 +131,8 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
 			connection = gb_connection_create(bundle, cport_id,
 							  NULL);
 			if (IS_ERR(connection)) {
-				dev_err(&bundle->dev, "failed to create SPI connection (%ld)\n",
-					PTR_ERR(connection));
+				dev_err(&bundle->dev, "failed to create SPI connection (%pe)\n",
+					connection);
 			} else {
 				fw_core->spi_connection = connection;
 			}
@@ -149,8 +149,8 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
 			connection = gb_connection_create(bundle, cport_id,
 							  NULL);
 			if (IS_ERR(connection)) {
-				dev_err(&bundle->dev, "failed to create Authentication connection (%ld)\n",
-					PTR_ERR(connection));
+				dev_err(&bundle->dev, "failed to create Authentication connection (%pe)\n",
+					connection);
 			} else {
 				fw_core->cap_connection = connection;
 			}

---
base-commit: ad6bb64332bb4297110950769ad5af52791e33a2
change-id: 20260314-greybus-pe-format-85993705ee22

Best regards,
-- 
Tomasz Unger <tomasz.unger@yahoo.pl>


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

* Re: [PATCH] staging: greybus: use %pe to print PTR_ERR in fw-core.c
  2026-03-15  8:40 ` [PATCH] staging: greybus: use %pe to print PTR_ERR in fw-core.c Tomasz Unger
@ 2026-03-15 17:45   ` Ethan Tidmore
  2026-03-16  8:44   ` Johan Hovold
  1 sibling, 0 replies; 3+ messages in thread
From: Ethan Tidmore @ 2026-03-15 17:45 UTC (permalink / raw)
  To: Tomasz Unger, Viresh Kumar, Johan Hovold, Alex Elder, Greg Kroah-Hartman
  Cc: greybus-dev, linux-staging, linux-kernel

On Sun Mar 15, 2026 at 3:40 AM CDT, Tomasz Unger wrote:
> Replace PTR_ERR() with %pe format specifier which directly prints
> the error pointer in a human readable way, making the code cleaner
> and more idiomatic.
>
> Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
> ---

LGTM.

Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>

Thanks,

ET

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

* Re: [PATCH] staging: greybus: use %pe to print PTR_ERR in fw-core.c
  2026-03-15  8:40 ` [PATCH] staging: greybus: use %pe to print PTR_ERR in fw-core.c Tomasz Unger
  2026-03-15 17:45   ` Ethan Tidmore
@ 2026-03-16  8:44   ` Johan Hovold
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2026-03-16  8:44 UTC (permalink / raw)
  To: Tomasz Unger
  Cc: Viresh Kumar, Alex Elder, Greg Kroah-Hartman, greybus-dev,
	linux-staging, linux-kernel

On Sun, Mar 15, 2026 at 09:40:48AM +0100, Tomasz Unger wrote:
> Replace PTR_ERR() with %pe format specifier which directly prints
> the error pointer in a human readable way, making the code cleaner
> and more idiomatic.

No, this is only results in inconsistency as Greybus logs all other
errnos numerically (which is perfectly sufficient).

See also:

	https://lore.kernel.org/all/20251029132922.17329-1-johan@kernel.org/

Johan

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

end of thread, other threads:[~2026-03-16  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20260315-greybus-pe-format-v1-1-d923fbed3097.ref@yahoo.pl>
2026-03-15  8:40 ` [PATCH] staging: greybus: use %pe to print PTR_ERR in fw-core.c Tomasz Unger
2026-03-15 17:45   ` Ethan Tidmore
2026-03-16  8:44   ` Johan Hovold

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

all inboxes | Powered by JetHome®