diff options
author | Dennis Chen <dechen@redhat.com> | 2025-07-16 12:57:50 -0400 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-07-17 18:09:27 -0700 |
commit | a93f38ebff577a8f131c565ac0fa3d281084df3e (patch) | |
tree | 49cb462c5cc98843414fcd5a4c29279b5b9c84e9 | |
parent | ffe5aedc439cd59c0fb267c845a733fbb41532de (diff) |
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 <dechen@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/20250716165750.561175-1-dechen@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/netdevsim/hwstats.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/netdevsim/hwstats.c b/drivers/net/netdevsim/hwstats.c index 66b3215db3ac..1abe48e35ca3 100644 --- a/drivers/net/netdevsim/hwstats.c +++ b/drivers/net/netdevsim/hwstats.c @@ -220,7 +220,6 @@ nsim_dev_hwstats_enable_ifindex(struct nsim_dev_hwstats *hwstats, struct nsim_dev_hwstats_netdev *hwsdev; struct nsim_dev *nsim_dev; struct net_device *netdev; - bool notify = false; struct net *net; int err = 0; @@ -251,11 +250,9 @@ nsim_dev_hwstats_enable_ifindex(struct nsim_dev_hwstats *hwstats, if (netdev_offload_xstats_enabled(netdev, type)) { nsim_dev_hwsdev_enable(hwsdev, NULL); - notify = true; + rtnl_offload_xstats_notify(netdev); } - if (notify) - rtnl_offload_xstats_notify(netdev); rtnl_unlock(); return err; |