* [PATCH net-next] igb: make igb_set_fc_watermarks() return void
@ 2020-05-07 11:09 Jason Yan
2020-05-21 7:27 ` Brown, Aaron F
0 siblings, 1 reply; 2+ messages in thread
From: Jason Yan @ 2020-05-07 11:09 UTC (permalink / raw)
To: jeffrey.t.kirsher, davem, yanaijie, intel-wired-lan, netdev,
linux-kernel
This function always return 0 now, we can make it return void to
simplify the code. This fixes the following coccicheck warning:
drivers/net/ethernet/intel/igb/e1000_mac.c:728:5-12: Unneeded variable:
"ret_val". Return "0" on line 751
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
drivers/net/ethernet/intel/igb/e1000_mac.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_mac.c b/drivers/net/ethernet/intel/igb/e1000_mac.c
index 79ee0a747260..3254737c07a3 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mac.c
+++ b/drivers/net/ethernet/intel/igb/e1000_mac.c
@@ -12,7 +12,7 @@
#include "igb.h"
static s32 igb_set_default_fc(struct e1000_hw *hw);
-static s32 igb_set_fc_watermarks(struct e1000_hw *hw);
+static void igb_set_fc_watermarks(struct e1000_hw *hw);
/**
* igb_get_bus_info_pcie - Get PCIe bus information
@@ -687,7 +687,7 @@ s32 igb_setup_link(struct e1000_hw *hw)
wr32(E1000_FCTTV, hw->fc.pause_time);
- ret_val = igb_set_fc_watermarks(hw);
+ igb_set_fc_watermarks(hw);
out:
@@ -723,9 +723,8 @@ void igb_config_collision_dist(struct e1000_hw *hw)
* flow control XON frame transmission is enabled, then set XON frame
* tansmission as well.
**/
-static s32 igb_set_fc_watermarks(struct e1000_hw *hw)
+static void igb_set_fc_watermarks(struct e1000_hw *hw)
{
- s32 ret_val = 0;
u32 fcrtl = 0, fcrth = 0;
/* Set the flow control receive threshold registers. Normally,
@@ -747,8 +746,6 @@ static s32 igb_set_fc_watermarks(struct e1000_hw *hw)
}
wr32(E1000_FCRTL, fcrtl);
wr32(E1000_FCRTH, fcrth);
-
- return ret_val;
}
/**
--
2.21.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH net-next] igb: make igb_set_fc_watermarks() return void
2020-05-07 11:09 [PATCH net-next] igb: make igb_set_fc_watermarks() return void Jason Yan
@ 2020-05-21 7:27 ` Brown, Aaron F
0 siblings, 0 replies; 2+ messages in thread
From: Brown, Aaron F @ 2020-05-21 7:27 UTC (permalink / raw)
To: Jason Yan, Kirsher, Jeffrey T, davem, intel-wired-lan, netdev,
linux-kernel
> From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> Behalf Of Jason Yan
> Sent: Thursday, May 7, 2020 4:09 AM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; davem@davemloft.net;
> yanaijie@huawei.com; intel-wired-lan@lists.osuosl.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH net-next] igb: make igb_set_fc_watermarks() return void
>
> This function always return 0 now, we can make it return void to
> simplify the code. This fixes the following coccicheck warning:
>
> drivers/net/ethernet/intel/igb/e1000_mac.c:728:5-12: Unneeded variable:
> "ret_val". Return "0" on line 751
>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> ---
> drivers/net/ethernet/intel/igb/e1000_mac.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-21 7:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 11:09 [PATCH net-next] igb: make igb_set_fc_watermarks() return void Jason Yan
2020-05-21 7:27 ` Brown, Aaron F
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).