From: Mahesh Bandewar Date: Wed, 18 Jan 2017 23:02:49 +0000 (-0800) Subject: net: remove duplicate code. X-Git-Tag: v4.14-rc1~1463^2~362^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b7cd0044e4a9f69aaf00511870b07fcdeda591d;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index ad5959e..c8f1f67 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 */