From: Antonio Quartulli Date: Wed, 30 Apr 2025 00:35:18 +0000 (+0200) Subject: ovpn: drop useless reg_state check in keepalive worker X-Git-Tag: v6.16-rc1~132^2~82^2~2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=adcdaac57d3ccb38f2f1b0a8da31b5c1403385f0;p=linux-block.git ovpn: drop useless reg_state check in keepalive worker The keepalive worker is cancelled before calling unregister_netdevice_queue(), therefore it will never hit a situation where the reg_state can be different than NETDEV_REGISTERED. For this reason, checking reg_state is useless and the condition can be removed. Signed-off-by: Antonio Quartulli --- diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c index a37f89fffb02..24eb9d81429e 100644 --- a/drivers/net/ovpn/peer.c +++ b/drivers/net/ovpn/peer.c @@ -1353,8 +1353,7 @@ void ovpn_peer_keepalive_work(struct work_struct *work) } /* prevent rearming if the interface is being destroyed */ - if (next_run > 0 && - READ_ONCE(ovpn->dev->reg_state) == NETREG_REGISTERED) { + if (next_run > 0) { netdev_dbg(ovpn->dev, "scheduling keepalive work: now=%llu next_run=%llu delta=%llu\n", next_run, now, next_run - now);