net: remove duplicate code.
authorMahesh Bandewar <maheshb@google.com>
Wed, 18 Jan 2017 23:02:49 +0000 (15:02 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Jan 2017 17:22:25 +0000 (12:22 -0500)
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>
net/core/dev.c

index ad5959e561166f445bdd9d7260652a338f74cfea..c8f1f67ff16c97a9c785ab7338410c5b9ad8ef3a 100644 (file)
@@ -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 */