All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: vmxnet3: remove multiple false checks in vmxnet3_ethtool.c
@ 2021-10-31  1:27 Jεan Sacren
  2021-11-02  3:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Jεan Sacren @ 2021-10-31  1:27 UTC (permalink / raw)
  To: doshir, pv-drivers, davem, kuba, netdev

From: Jean Sacren <sakiwit@gmail.com>

In one if branch, (ec->rx_coalesce_usecs != 0) is checked.  When it is
checked again in two more places, it is always false and has no effect
on the whole check expression.  We should remove it in both places.

In another if branch, (ec->use_adaptive_rx_coalesce != 0) is checked.
When it is checked again, it is always false.  We should remove the
entire branch with it.

In addition we might as well let C precedence dictate by getting rid of
two pairs of parentheses in the neighboring lines in order to keep
expressions on both sides of '||' in balance with checkpatch warning
silenced.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
 drivers/net/vmxnet3/vmxnet3_ethtool.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
index 5dd8360b21a0..16f3a2057b90 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
@@ -1134,9 +1134,8 @@ static int vmxnet3_set_coalesce(struct net_device *netdev,
 	}
 
 	if (ec->use_adaptive_rx_coalesce != 0) {
-		if ((ec->rx_coalesce_usecs != 0) ||
-		    (ec->tx_max_coalesced_frames != 0) ||
-		    (ec->rx_max_coalesced_frames != 0)) {
+		if (ec->tx_max_coalesced_frames != 0 ||
+		    ec->rx_max_coalesced_frames != 0) {
 			return -EINVAL;
 		}
 		memset(adapter->coal_conf, 0, sizeof(*adapter->coal_conf));
@@ -1146,11 +1145,6 @@ static int vmxnet3_set_coalesce(struct net_device *netdev,
 
 	if ((ec->tx_max_coalesced_frames != 0) ||
 	    (ec->rx_max_coalesced_frames != 0)) {
-		if ((ec->rx_coalesce_usecs != 0) ||
-		    (ec->use_adaptive_rx_coalesce != 0)) {
-			return -EINVAL;
-		}
-
 		if ((ec->tx_max_coalesced_frames >
 		    VMXNET3_COAL_STATIC_MAX_DEPTH) ||
 		    (ec->rx_max_coalesced_frames >

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

* Re: [PATCH net-next] net: vmxnet3: remove multiple false checks in vmxnet3_ethtool.c
  2021-10-31  1:27 [PATCH net-next] net: vmxnet3: remove multiple false checks in vmxnet3_ethtool.c Jεan Sacren
@ 2021-11-02  3:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-02  3:00 UTC (permalink / raw)
  To: =?utf-8?q?J=CE=B5an_Sacren_=3Csakiwit=40gmail=2Ecom=3E?=
  Cc: doshir, pv-drivers, davem, kuba, netdev

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 30 Oct 2021 19:27:28 -0600 you wrote:
> From: Jean Sacren <sakiwit@gmail.com>
> 
> In one if branch, (ec->rx_coalesce_usecs != 0) is checked.  When it is
> checked again in two more places, it is always false and has no effect
> on the whole check expression.  We should remove it in both places.
> 
> In another if branch, (ec->use_adaptive_rx_coalesce != 0) is checked.
> When it is checked again, it is always false.  We should remove the
> entire branch with it.
> 
> [...]

Here is the summary with links:
  - [net-next] net: vmxnet3: remove multiple false checks in vmxnet3_ethtool.c
    https://git.kernel.org/netdev/net-next/c/1d6d336fed6b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-11-02  3:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-31  1:27 [PATCH net-next] net: vmxnet3: remove multiple false checks in vmxnet3_ethtool.c Jεan Sacren
2021-11-02  3:00 ` patchwork-bot+netdevbpf

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.