Skip to contentSkip to conversation

RDMA/irdma: Remove the redundant return

PATCH Applied [email protected] 5 participants 6 messages Jan 9, 2022 – Jan 10, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/irdma: Remove the redundant return

From: Zhu Yanjun <[email protected]>

The type of the function i40iw_remove is void. So remove the unnecessary return.

---
 drivers/infiniband/hw/irdma/i40iw_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/irdma/i40iw_if.c +1 -1
index d219f64b2c3d..43e962b97d6a 100644
@@ -198,7 +198,7 @@ static void i40iw_remove(struct auxiliary_device *aux_dev)
 							       aux_dev);
 	struct i40e_info *cdev_info = i40e_adev->ldev;
 
-	return i40e_client_device_unregister(cdev_info);
+	i40e_client_device_unregister(cdev_info);
 }
 
 static const struct auxiliary_device_id i40iw_auxiliary_id_table[] = {
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · On Mon, Jan 10, 2022 at 02:37:33AM -0500, [email protected] wrote:

From: Zhu Yanjun <[email protected]>

The type of the function i40iw_remove is void. So remove the unnecessary return.

---
 drivers/infiniband/hw/irdma/i40iw_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/irdma/i40iw_if.c +0 -0
index d219f64b2c3d..43e962b97d6a 100644

drivers/infiniband/hw/irdma/i40iw_if.c static void i40iw_remove(struct auxiliary_device *aux_dev) · line 201

Quoted 5 lines
drivers/infiniband/hw/irdma/i40iw_if.c +1 -1
@@ -198,7 +198,7 @@ static void i40iw_remove(struct auxiliary_device *aux_dev)
 							       aux_dev);
 	struct i40e_info *cdev_info = i40e_adev->ldev;
 
-	return i40e_client_device_unregister(cdev_info);
+	i40e_client_device_unregister(cdev_info);

I'm surprised that compiler didn't warn about extra parameter to return.

Thanks,

#2 lore raw
Quoted 17 lines · Leon Romanovsky
Quoted 16 lines · On Mon, Jan 10, 2022 at 02:37:33AM -0500, [email protected] wrote:

From: Zhu Yanjun <[email protected]>

The type of the function i40iw_remove is void. So remove the unnecessary return.

 drivers/infiniband/hw/irdma/i40iw_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/irdma/i40iw_if.c +1 -0
index d219f64b2c3d..43e962b97d6a 100644
+++ b/drivers/infiniband/hw/irdma/i40iw_if.c
@@ -198,7 +198,7 @@ static void i40iw_remove(struct auxiliary_device *aux_dev)
 							       aux_dev);
 	struct i40e_info *cdev_info = i40e_adev->ldev;
 
Quoted 4 lines

drivers/infiniband/hw/irdma/i40iw_if.c static void i40iw_remove(struct auxiliary_device *aux_dev) · line 201

Quoted 2 lines
drivers/infiniband/hw/irdma/i40iw_if.c +1 -1
-	return i40e_client_device_unregister(cdev_info);
+	i40e_client_device_unregister(cdev_info);

I'm surprised that compiler didn't warn about extra parameter to return.

It is odd, but valid, C to return void like this..

Jason

#3 lore raw
Quoted 18 lines · Jason Gunthorpe
Quoted 17 lines · Leon Romanovsky
Quoted 16 lines · On Mon, Jan 10, 2022 at 02:37:33AM -0500, [email protected] wrote:

From: Zhu Yanjun <[email protected]>

The type of the function i40iw_remove is void. So remove the unnecessary return.

 drivers/infiniband/hw/irdma/i40iw_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/irdma/i40iw_if.c +1 -0
index d219f64b2c3d..43e962b97d6a 100644
+++ b/drivers/infiniband/hw/irdma/i40iw_if.c
@@ -198,7 +198,7 @@ static void i40iw_remove(struct auxiliary_device *aux_dev)
 							       aux_dev);
 	struct i40e_info *cdev_info = i40e_adev->ldev;
 
Quoted 6 lines
Quoted 4 lines

drivers/infiniband/hw/irdma/i40iw_if.c static void i40iw_remove(struct auxiliary_device *aux_dev) · line 201

Quoted 2 lines
drivers/infiniband/hw/irdma/i40iw_if.c +1 -1
-	return i40e_client_device_unregister(cdev_info);
+	i40e_client_device_unregister(cdev_info);

I'm surprised that compiler didn't warn about extra parameter to return.

It is odd, but valid, C to return void like this..

Any idea where such C expression can be useful?

Thanks

Quoted 2 lines

Jason

maintainer Applied
#5 lore raw
In reply to [email protected]
Quoted 11 lines · On Mon, Jan 10, 2022 at 02:37:33AM -0500, [email protected] wrote:

From: Zhu Yanjun <[email protected]>

The type of the function i40iw_remove is void. So remove the unnecessary return.

---
 drivers/infiniband/hw/irdma/i40iw_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason