Skip to contentSkip to conversation

staging: greybus: replace PTR_ERR() with %pe in error messages

PATCH Superseded [email protected] 2 participants 3 messages Oct 12

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: greybus: replace PTR_ERR() with %pe in error messages

From: Yalagada Pavan Kumar <[email protected]>

Use %pe to print error pointers directly and display their error names.

Keep the other PTR_ERR() call because its return value is needed for ret.

---
 drivers/staging/greybus/fw-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/greybus/fw-core.c +6 -6
index 2016a74f137f..7053afa9ab3e 100644
@@ -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;
 			}
Signature · 1 line
2.43.0
#1 lore raw

For this patch I have only one immediate suggestion.

The firmware management case (case GREYBUS_PROTOCOL_FW_MANAGEMENT:) should match the other cases. Found around line 96.

You've changed the pointer variable to display and this seems correct.

For consistency, each should match.

Quoted 55 lines · On Mon, Oct 12, 2026 at 11:00 AM <[email protected]> wrote:

From: Yalagada Pavan Kumar <[email protected]>

Use %pe to print error pointers directly and display their error names.

Keep the other PTR_ERR() call because its return value is needed for ret.

---
 drivers/staging/greybus/fw-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/greybus/fw-core.c +6 -7
index 2016a74f137f..7053afa9ab3e 100644
@@ -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.43.0

#2 lore raw
Quoted 4 lines · Jeremy Clifton

For this patch I have only one immediate suggestion.

The firmware management case (case GREYBUS_PROTOCOL_FW_MANAGEMENT:) should match the other cases. Found around line 96.

Thanks for the review. I'll update the firmware management case to use %pe for consistency and send a revised patch.

Thanks,
Pavan

Quoted 61 lines

You've changed the pointer variable to display and this seems correct.

For consistency, each should match.

Quoted 55 lines · On Mon, Oct 12, 2026 at 11:00 AM <[email protected]> wrote:

From: Yalagada Pavan Kumar <[email protected]>

Use %pe to print error pointers directly and display their error names.

Keep the other PTR_ERR() call because its return value is needed for ret.

---
 drivers/staging/greybus/fw-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/greybus/fw-core.c +6 -7
index 2016a74f137f..7053afa9ab3e 100644
@@ -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.43.0