diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-10 05:49:09 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:55:52 -0400 |
commit | 9b7726523523472ead660b1d45df29dcaf6cc5c0 (patch) | |
tree | 4f3ac1906c582ba2595941e5ca39b4cd21660ac6 /net/core/dev.c | |
parent | 1c1e87edb9aa38b9e1ae807a6d88fcfd350a55c0 (diff) |
[NET]: Remove double dev->flags checking when calling dev_close()
The unregister_netdevice() and dev_change_net_namespace()
both check for dev->flags to be IFF_UP before calling the
dev_close(), but the dev_close() checks for IFF_UP itself,
so remove those unneeded checks.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index e7e728aea9f3..1e169a541ce7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -3893,8 +3893,7 @@ void unregister_netdevice(struct net_device *dev) | |||
3893 | BUG_ON(dev->reg_state != NETREG_REGISTERED); | 3893 | BUG_ON(dev->reg_state != NETREG_REGISTERED); |
3894 | 3894 | ||
3895 | /* If device is running, close it first. */ | 3895 | /* If device is running, close it first. */ |
3896 | if (dev->flags & IFF_UP) | 3896 | dev_close(dev); |
3897 | dev_close(dev); | ||
3898 | 3897 | ||
3899 | /* And unlink it from device chain. */ | 3898 | /* And unlink it from device chain. */ |
3900 | unlist_netdevice(dev); | 3899 | unlist_netdevice(dev); |
@@ -4018,8 +4017,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char | |||
4018 | */ | 4017 | */ |
4019 | 4018 | ||
4020 | /* If device is running close it first. */ | 4019 | /* If device is running close it first. */ |
4021 | if (dev->flags & IFF_UP) | 4020 | dev_close(dev); |
4022 | dev_close(dev); | ||
4023 | 4021 | ||
4024 | /* And unlink it from device chain */ | 4022 | /* And unlink it from device chain */ |
4025 | err = -ENODEV; | 4023 | err = -ENODEV; |