Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dennis Chen and committed by
Jakub Kicinski
a93f38eb ffe5aedc

+1 -4
+1 -4
drivers/net/netdevsim/hwstats.c
··· 220 220 struct nsim_dev_hwstats_netdev *hwsdev; 221 221 struct nsim_dev *nsim_dev; 222 222 struct net_device *netdev; 223 - bool notify = false; 224 223 struct net *net; 225 224 int err = 0; 226 225 ··· 250 251 251 252 if (netdev_offload_xstats_enabled(netdev, type)) { 252 253 nsim_dev_hwsdev_enable(hwsdev, NULL); 253 - notify = true; 254 + rtnl_offload_xstats_notify(netdev); 254 255 } 255 256 256 - if (notify) 257 - rtnl_offload_xstats_notify(netdev); 258 257 rtnl_unlock(); 259 258 return err; 260 259