aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorMahesh Bandewar <maheshb@google.com>2017-01-18 15:02:49 -0800
committerDavid S. Miller <davem@davemloft.net>2017-01-20 12:22:25 -0500
commit1b7cd0044e4a9f69aaf00511870b07fcdeda591d (patch)
treefce5cccf4992d44ea8c74986c8c21123e5d6f687 /net/core
parentfq_codel: Avoid regenerating skb flow hash unless necessary (diff)
downloadlinux-dev-1b7cd0044e4a9f69aaf00511870b07fcdeda591d.tar.xz
linux-dev-1b7cd0044e4a9f69aaf00511870b07fcdeda591d.zip
net: remove duplicate code.
netdev_rx_handler_register() checks to see if the handler is already busy which was recently separated into netdev_is_rx_handler_busy(). So use the same function inside register() to avoid code duplication. Essentially this change should be a no-op Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ad5959e56116..c8f1f67ff16c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3961,9 +3961,7 @@ int netdev_rx_handler_register(struct net_device *dev,
rx_handler_func_t *rx_handler,
void *rx_handler_data)
{
- ASSERT_RTNL();
-
- if (dev->rx_handler)
+ if (netdev_is_rx_handler_busy(dev))
return -EBUSY;
/* Note: rx_handler_data must be set before rx_handler */