[PATCH] platform/surface: aggregator: Omit a variable reassignment in ssam_serial_hub_probe()

Markus Elfring posted 1 patch 3 months, 2 weeks ago
drivers/platform/surface/aggregator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] platform/surface: aggregator: Omit a variable reassignment in ssam_serial_hub_probe()
Posted by Markus Elfring 3 months, 2 weeks ago
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 20 Oct 2025 16:34:59 +0200

An error code was assigned to a variable and checked accordingly.
This value was passed to a dev_err_probe() call in an if branch.
This function is documented in the way that the same value is returned.
Thus delete a redundant variable reassignment.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/platform/surface/aggregator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/surface/aggregator/core.c b/drivers/platform/surface/aggregator/core.c
index c58e1fdd1a5f..c7e05f7bc199 100644
--- a/drivers/platform/surface/aggregator/core.c
+++ b/drivers/platform/surface/aggregator/core.c
@@ -676,7 +676,7 @@ static int ssam_serial_hub_probe(struct serdev_device *serdev)
 
 	status = ssam_serdev_setup(ssh, serdev);
 	if (status) {
-		status = dev_err_probe(dev, status, "failed to setup serdev\n");
+		dev_err_probe(dev, status, "failed to setup serdev\n");
 		goto err_devinit;
 	}
 
-- 
2.51.1
Re: [PATCH] platform/surface: aggregator: Omit a variable reassignment in ssam_serial_hub_probe()
Posted by Ilpo Järvinen 3 months, 1 week ago
On Mon, 20 Oct 2025 16:43:16 +0200, Markus Elfring wrote:

> An error code was assigned to a variable and checked accordingly.
> This value was passed to a dev_err_probe() call in an if branch.
> This function is documented in the way that the same value is returned.
> Thus delete a redundant variable reassignment.
> 
> The source code was transformed by using the Coccinelle software.
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/surface: aggregator: Omit a variable reassignment in ssam_serial_hub_probe()
      commit: 6581e83ea65dc117f8c5cae1089550fe7e779cd7

--
 i.