Re: [PATCH net-next v2] net: remove unused netdev_unregistering()
From: Eric Dumazet <edumazet@google.com>
Date: 2022-09-28 16:35:34
On Wed, Sep 28, 2022 at 9:17 AM Juhee Kang [off-list ref] wrote:
A helper function which is netdev_unregistering on nedevice.h is no loger used. Thus, netdev_unregistering removes from netdevice.h.
I think we could explain a bit more why we think this function was not
really needed.
It was added in commit 8397ed36b7c5 ("net: ipv6: Release route when
device is unregistering")
then later, commit 27c6fa73f93b ("ipv6: Set nexthop flags upon carrier
change") removed the
only user of this helper. The only possible/valid case where we access
dev->reg_state
is in notifiers, and notifiers already have access to the 'event',
being NETDEV_UNREGISTER
or NETDEV_DOWN...
quoted hunk ↗ jump to hunk
Signed-off-by: Juhee Kang <redacted> --- v2: - v1 link : https://lore.kernel.org/netdev/20220923160937.1912-1-claudiajkang@gmail.com/ (local) - Remove netdev_unregistering(). include/linux/netdevice.h | 5 ----- 1 file changed, 5 deletions(-)diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9f42fc871c3b..66d10bcaa6f8 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h@@ -5100,11 +5100,6 @@ static inline const char *netdev_name(const struct net_device *dev) return dev->name; } -static inline bool netdev_unregistering(const struct net_device *dev) -{ - return dev->reg_state == NETREG_UNREGISTERING; -} - static inline const char *netdev_reg_state(const struct net_device *dev) { switch (dev->reg_state) { --2.34.1