All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] net: ethernet: fix returnvar.cocci warnings
@ 2021-08-20  2:37 ` jing yangyang
  0 siblings, 0 replies; 2+ messages in thread
From: jing yangyang @ 2021-08-20  2:37 UTC (permalink / raw)
  To: Jesse Brandeburg
  Cc: Tony Nguyen, David S . Miller, Jakub Kicinski, Tariq Toukan,
	intel-wired-lan, netdev, linux-kernel, linux-rdma, jing yangyang,
	Zeal Robot

Remove unneeded variables when "0" can be returned.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>
---
 drivers/net/ethernet/intel/iavf/iavf_adminq.c | 4 +---
 drivers/net/ethernet/mellanox/mlx4/port.c     | 8 ++------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_adminq.c b/drivers/net/ethernet/intel/iavf/iavf_adminq.c
index 9fa3fa9..cd4e6a2 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_adminq.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.c
@@ -551,15 +551,13 @@ enum iavf_status iavf_init_adminq(struct iavf_hw *hw)
  **/
 enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw)
 {
-	enum iavf_status ret_code = 0;
-
 	if (iavf_check_asq_alive(hw))
 		iavf_aq_queue_shutdown(hw, true);
 
 	iavf_shutdown_asq(hw);
 	iavf_shutdown_arq(hw);
 
-	return ret_code;
+	return 0;
 }
 
 /**
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 256a06b..754c253 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -1820,9 +1820,7 @@ int mlx4_SET_MCAST_FLTR_wrapper(struct mlx4_dev *dev, int slave,
 				struct mlx4_cmd_mailbox *outbox,
 				struct mlx4_cmd_info *cmd)
 {
-	int err = 0;
-
-	return err;
+	return 0;
 }
 
 int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port,
@@ -1840,9 +1838,7 @@ int mlx4_SET_VLAN_FLTR_wrapper(struct mlx4_dev *dev, int slave,
 			       struct mlx4_cmd_mailbox *outbox,
 			       struct mlx4_cmd_info *cmd)
 {
-	int err = 0;
-
-	return err;
+	return 0;
 }
 
 int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, int slave,
-- 
1.8.3.1



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

* [Intel-wired-lan] [PATCH linux-next] net: ethernet: fix returnvar.cocci warnings
@ 2021-08-20  2:37 ` jing yangyang
  0 siblings, 0 replies; 2+ messages in thread
From: jing yangyang @ 2021-08-20  2:37 UTC (permalink / raw)
  To: intel-wired-lan

Remove unneeded variables when "0" can be returned.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>
---
 drivers/net/ethernet/intel/iavf/iavf_adminq.c | 4 +---
 drivers/net/ethernet/mellanox/mlx4/port.c     | 8 ++------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_adminq.c b/drivers/net/ethernet/intel/iavf/iavf_adminq.c
index 9fa3fa9..cd4e6a2 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_adminq.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.c
@@ -551,15 +551,13 @@ enum iavf_status iavf_init_adminq(struct iavf_hw *hw)
  **/
 enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw)
 {
-	enum iavf_status ret_code = 0;
-
 	if (iavf_check_asq_alive(hw))
 		iavf_aq_queue_shutdown(hw, true);
 
 	iavf_shutdown_asq(hw);
 	iavf_shutdown_arq(hw);
 
-	return ret_code;
+	return 0;
 }
 
 /**
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 256a06b..754c253 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -1820,9 +1820,7 @@ int mlx4_SET_MCAST_FLTR_wrapper(struct mlx4_dev *dev, int slave,
 				struct mlx4_cmd_mailbox *outbox,
 				struct mlx4_cmd_info *cmd)
 {
-	int err = 0;
-
-	return err;
+	return 0;
 }
 
 int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port,
@@ -1840,9 +1838,7 @@ int mlx4_SET_VLAN_FLTR_wrapper(struct mlx4_dev *dev, int slave,
 			       struct mlx4_cmd_mailbox *outbox,
 			       struct mlx4_cmd_info *cmd)
 {
-	int err = 0;
-
-	return err;
+	return 0;
 }
 
 int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, int slave,
-- 
1.8.3.1



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

end of thread, other threads:[~2021-08-20  2:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20  2:37 [PATCH linux-next] net: ethernet: fix returnvar.cocci warnings jing yangyang
2021-08-20  2:37 ` [Intel-wired-lan] " jing yangyang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.