* [PATCH 0/1] staging: greybus: fw-core: use %pe for error printing
@ 2026-01-18 6:05 Archit Anant
2026-01-18 6:05 ` [PATCH 1/1] " Archit Anant
0 siblings, 1 reply; 3+ messages in thread
From: Archit Anant @ 2026-01-18 6:05 UTC (permalink / raw)
To: vireshk, johan, elder
Cc: gregkh, greybus-dev, linux-staging, linux-kernel, Archit Anant
This patch modernizes error printing in the Greybus firmware core driver.
It replaces the old 'PTR_ERR' + '%ld' pattern with the newer '%pe'
format specifier, which prints error names instead of numbers,
making it easy for debuging.
Archit Anant (1):
staging: greybus: fw-core: use %pe for error printing
drivers/staging/greybus/fw-core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] staging: greybus: fw-core: use %pe for error printing
2026-01-18 6:05 [PATCH 0/1] staging: greybus: fw-core: use %pe for error printing Archit Anant
@ 2026-01-18 6:05 ` Archit Anant
2026-01-19 10:25 ` Johan Hovold
0 siblings, 1 reply; 3+ messages in thread
From: Archit Anant @ 2026-01-18 6:05 UTC (permalink / raw)
To: vireshk, johan, elder
Cc: gregkh, greybus-dev, linux-staging, linux-kernel, Archit Anant
Use the %pe printk format specifier to print error codes as symbolic
names (e.g., -ENOMEM) instead of numeric values. This improves
readability of error logs.
Issue identified by coccicheck using the ptr_err_to_pe.cocci script.
Signed-off-by: Archit Anant <architanant5@gmail.com>
---
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 0fb15a60412f..1ad404d69b87 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;
}
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] staging: greybus: fw-core: use %pe for error printing
2026-01-18 6:05 ` [PATCH 1/1] " Archit Anant
@ 2026-01-19 10:25 ` Johan Hovold
0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2026-01-19 10:25 UTC (permalink / raw)
To: Archit Anant
Cc: vireshk, elder, gregkh, greybus-dev, linux-staging, linux-kernel,
Julia Lawall
[ +CC: Julia ]
On Sun, Jan 18, 2026 at 11:35:48AM +0530, Archit Anant wrote:
> Use the %pe printk format specifier to print error codes as symbolic
> names (e.g., -ENOMEM) instead of numeric values. This improves
> readability of error logs.
Greybus and this driver uses numerical errnos in its error messages so
this will introduce a needless inconsistency for no good reason.
> Issue identified by coccicheck using the ptr_err_to_pe.cocci script.
Also see:
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-01-19 10:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-18 6:05 [PATCH 0/1] staging: greybus: fw-core: use %pe for error printing Archit Anant
2026-01-18 6:05 ` [PATCH 1/1] " Archit Anant
2026-01-19 10:25 ` Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox