Skip to content

Commit a93f38e

Browse files
dchen5022kuba-moo
authored andcommitted
netdevsim: remove redundant branch
bool notify is referenced nowhere else in the function except to check whether or not to call rtnl_offload_xstats_notify(). Remove it and move the call to the previous branch. Signed-off-by: Dennis Chen <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Petr Machata <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ffe5aed commit a93f38e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/net/netdevsim/hwstats.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ nsim_dev_hwstats_enable_ifindex(struct nsim_dev_hwstats *hwstats,
220220
struct nsim_dev_hwstats_netdev *hwsdev;
221221
struct nsim_dev *nsim_dev;
222222
struct net_device *netdev;
223-
bool notify = false;
224223
struct net *net;
225224
int err = 0;
226225

@@ -251,11 +250,9 @@ nsim_dev_hwstats_enable_ifindex(struct nsim_dev_hwstats *hwstats,
251250

252251
if (netdev_offload_xstats_enabled(netdev, type)) {
253252
nsim_dev_hwsdev_enable(hwsdev, NULL);
254-
notify = true;
253+
rtnl_offload_xstats_notify(netdev);
255254
}
256255

257-
if (notify)
258-
rtnl_offload_xstats_notify(netdev);
259256
rtnl_unlock();
260257
return err;
261258

0 commit comments

Comments
 (0)