Skip to content

Commit 1d6d336

Browse files
sacrenkuba-moo
authored andcommitted
net: vmxnet3: remove multiple false checks in vmxnet3_ethtool.c
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8a75e30 commit 1d6d336

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/net/vmxnet3/vmxnet3_ethtool.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,9 +1134,8 @@ static int vmxnet3_set_coalesce(struct net_device *netdev,
11341134
}
11351135

11361136
if (ec->use_adaptive_rx_coalesce != 0) {
1137-
if ((ec->rx_coalesce_usecs != 0) ||
1138-
(ec->tx_max_coalesced_frames != 0) ||
1139-
(ec->rx_max_coalesced_frames != 0)) {
1137+
if (ec->tx_max_coalesced_frames != 0 ||
1138+
ec->rx_max_coalesced_frames != 0) {
11401139
return -EINVAL;
11411140
}
11421141
memset(adapter->coal_conf, 0, sizeof(*adapter->coal_conf));
@@ -1146,11 +1145,6 @@ static int vmxnet3_set_coalesce(struct net_device *netdev,
11461145

11471146
if ((ec->tx_max_coalesced_frames != 0) ||
11481147
(ec->rx_max_coalesced_frames != 0)) {
1149-
if ((ec->rx_coalesce_usecs != 0) ||
1150-
(ec->use_adaptive_rx_coalesce != 0)) {
1151-
return -EINVAL;
1152-
}
1153-
11541148
if ((ec->tx_max_coalesced_frames >
11551149
VMXNET3_COAL_STATIC_MAX_DEPTH) ||
11561150
(ec->rx_max_coalesced_frames >

0 commit comments

Comments
 (0)