]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: usbnet: Fix -Wcast-function-type
authorPhong Tran <tranmanphong@gmail.com>
Tue, 26 Nov 2019 13:54:13 +0000 (20:54 +0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Nov 2019 22:03:58 +0000 (14:03 -0800)
correct usage prototype of callback in tasklet_init().
Report by https://github.com/KSPP/linux/issues/20

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/usbnet.c

index dde05e2fdc3e6325431f079d04db8fc898be4a67..30e511c2c8d017f7f168dd3ef839314627e7ee53 100644 (file)
@@ -1573,6 +1573,13 @@ static void usbnet_bh (struct timer_list *t)
        }
 }
 
+static void usbnet_bh_tasklet(unsigned long data)
+{
+       struct timer_list *t = (struct timer_list *)data;
+
+       usbnet_bh(t);
+}
+
 
 /*-------------------------------------------------------------------------
  *
@@ -1700,7 +1707,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
        skb_queue_head_init (&dev->txq);
        skb_queue_head_init (&dev->done);
        skb_queue_head_init(&dev->rxq_pause);
-       dev->bh.func = (void (*)(unsigned long))usbnet_bh;
+       dev->bh.func = usbnet_bh_tasklet;
        dev->bh.data = (unsigned long)&dev->delay;
        INIT_WORK (&dev->kevent, usbnet_deferred_kevent);
        init_usb_anchor(&dev->deferred);