Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] drivers: net: hso: Fix -Wcast-function-type
@ 2019-11-25 14:54 Phong Tran
  2019-11-25 14:54 ` [PATCH 2/2] drivers: net: usbnet: " Phong Tran
  0 siblings, 1 reply; 7+ messages in thread
From: Phong Tran @ 2019-11-25 14:54 UTC (permalink / raw)
  To: davem, gregkh, oneukum
  Cc: alexios.zavras, johan, allison, tglx, benquike, linux-usb,
	netdev, linux-kernel, Phong Tran

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>
---
 drivers/net/usb/hso.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 74849da031fa..ca827802f291 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1214,8 +1214,9 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
  * This needs to be a tasklet otherwise we will
  * end up recursively calling this function.
  */
-static void hso_unthrottle_tasklet(struct hso_serial *serial)
+static void hso_unthrottle_tasklet(unsigned long data)
 {
+	struct hso_serial *serial = (struct hso_serial *)data;
 	unsigned long flags;
 
 	spin_lock_irqsave(&serial->serial_lock, flags);
@@ -1265,7 +1266,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
 		/* Force default termio settings */
 		_hso_serial_set_termios(tty, NULL);
 		tasklet_init(&serial->unthrottle_tasklet,
-			     (void (*)(unsigned long))hso_unthrottle_tasklet,
+			     hso_unthrottle_tasklet,
 			     (unsigned long)serial);
 		result = hso_start_serial_device(serial->parent, GFP_KERNEL);
 		if (result) {
-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] drivers: net: usbnet: Fix -Wcast-function-type
  2019-11-25 14:54 [PATCH 1/2] drivers: net: hso: Fix -Wcast-function-type Phong Tran
@ 2019-11-25 14:54 ` " Phong Tran
  2019-11-25 19:07   ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Phong Tran @ 2019-11-25 14:54 UTC (permalink / raw)
  To: davem, gregkh, oneukum
  Cc: alexios.zavras, johan, allison, tglx, benquike, linux-usb,
	netdev, linux-kernel, Phong Tran

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>
---
 drivers/net/usb/usbnet.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index dde05e2fdc3e..d10a5e6d0917 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1573,6 +1573,12 @@ 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 +1706,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);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drivers: net: usbnet: Fix -Wcast-function-type
  2019-11-25 14:54 ` [PATCH 2/2] drivers: net: usbnet: " Phong Tran
@ 2019-11-25 19:07   ` David Miller
  2019-11-26 13:54     ` [Patch v2 0/2] Fix -Wcast-function-type usb net drivers Phong Tran
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2019-11-25 19:07 UTC (permalink / raw)
  To: tranmanphong
  Cc: gregkh, oneukum, alexios.zavras, johan, allison, tglx, benquike,
	linux-usb, netdev, linux-kernel

From: Phong Tran <tranmanphong@gmail.com>
Date: Mon, 25 Nov 2019 21:54:43 +0700

> @@ -1573,6 +1573,12 @@ static void usbnet_bh (struct timer_list *t)
>  	}
>  }
>  
> +static void usbnet_bh_tasklet (unsigned long data)
                                ^

Please remove this space and resubmit the patch series.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Patch v2 0/2] Fix -Wcast-function-type usb net drivers
  2019-11-25 19:07   ` David Miller
@ 2019-11-26 13:54     ` Phong Tran
  2019-11-26 13:54       ` [Patch v2 1/2] net: hso: Fix -Wcast-function-type Phong Tran
                         ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Phong Tran @ 2019-11-26 13:54 UTC (permalink / raw)
  To: davem
  Cc: alexios.zavras, allison, benquike, gregkh, johan, linux-kernel,
	linux-usb, netdev, oneukum, tglx, tranmanphong

Change log with v1:
 - Modify suffix of patch subject.
 - Did the checkpatch.pl (remove the space, add a blank line).

Phong Tran (2):
  net: hso: Fix -Wcast-function-type
  net: usbnet: Fix -Wcast-function-type

 drivers/net/usb/hso.c    | 5 +++--
 drivers/net/usb/usbnet.c | 9 ++++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Patch v2 1/2] net: hso: Fix -Wcast-function-type
  2019-11-26 13:54     ` [Patch v2 0/2] Fix -Wcast-function-type usb net drivers Phong Tran
@ 2019-11-26 13:54       ` Phong Tran
  2019-11-26 13:54       ` [Patch v2 2/2] net: usbnet: " Phong Tran
  2019-11-26 22:04       ` [Patch v2 0/2] Fix -Wcast-function-type usb net drivers David Miller
  2 siblings, 0 replies; 7+ messages in thread
From: Phong Tran @ 2019-11-26 13:54 UTC (permalink / raw)
  To: davem
  Cc: alexios.zavras, allison, benquike, gregkh, johan, linux-kernel,
	linux-usb, netdev, oneukum, tglx, tranmanphong

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>
---
 drivers/net/usb/hso.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 74849da031fa..ca827802f291 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1214,8 +1214,9 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
  * This needs to be a tasklet otherwise we will
  * end up recursively calling this function.
  */
-static void hso_unthrottle_tasklet(struct hso_serial *serial)
+static void hso_unthrottle_tasklet(unsigned long data)
 {
+	struct hso_serial *serial = (struct hso_serial *)data;
 	unsigned long flags;
 
 	spin_lock_irqsave(&serial->serial_lock, flags);
@@ -1265,7 +1266,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
 		/* Force default termio settings */
 		_hso_serial_set_termios(tty, NULL);
 		tasklet_init(&serial->unthrottle_tasklet,
-			     (void (*)(unsigned long))hso_unthrottle_tasklet,
+			     hso_unthrottle_tasklet,
 			     (unsigned long)serial);
 		result = hso_start_serial_device(serial->parent, GFP_KERNEL);
 		if (result) {
-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Patch v2 2/2] net: usbnet: Fix -Wcast-function-type
  2019-11-26 13:54     ` [Patch v2 0/2] Fix -Wcast-function-type usb net drivers Phong Tran
  2019-11-26 13:54       ` [Patch v2 1/2] net: hso: Fix -Wcast-function-type Phong Tran
@ 2019-11-26 13:54       ` " Phong Tran
  2019-11-26 22:04       ` [Patch v2 0/2] Fix -Wcast-function-type usb net drivers David Miller
  2 siblings, 0 replies; 7+ messages in thread
From: Phong Tran @ 2019-11-26 13:54 UTC (permalink / raw)
  To: davem
  Cc: alexios.zavras, allison, benquike, gregkh, johan, linux-kernel,
	linux-usb, netdev, oneukum, tglx, tranmanphong

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>
---
 drivers/net/usb/usbnet.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index dde05e2fdc3e..30e511c2c8d0 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -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);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Patch v2 0/2] Fix -Wcast-function-type usb net drivers
  2019-11-26 13:54     ` [Patch v2 0/2] Fix -Wcast-function-type usb net drivers Phong Tran
  2019-11-26 13:54       ` [Patch v2 1/2] net: hso: Fix -Wcast-function-type Phong Tran
  2019-11-26 13:54       ` [Patch v2 2/2] net: usbnet: " Phong Tran
@ 2019-11-26 22:04       ` David Miller
  2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2019-11-26 22:04 UTC (permalink / raw)
  To: tranmanphong
  Cc: alexios.zavras, allison, benquike, gregkh, johan, linux-kernel,
	linux-usb, netdev, oneukum, tglx

From: Phong Tran <tranmanphong@gmail.com>
Date: Tue, 26 Nov 2019 20:54:11 +0700

> Change log with v1:
>  - Modify suffix of patch subject.
>  - Did the checkpatch.pl (remove the space, add a blank line).

Series applied, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 14:54 [PATCH 1/2] drivers: net: hso: Fix -Wcast-function-type Phong Tran
2019-11-25 14:54 ` [PATCH 2/2] drivers: net: usbnet: " Phong Tran
2019-11-25 19:07   ` David Miller
2019-11-26 13:54     ` [Patch v2 0/2] Fix -Wcast-function-type usb net drivers Phong Tran
2019-11-26 13:54       ` [Patch v2 1/2] net: hso: Fix -Wcast-function-type Phong Tran
2019-11-26 13:54       ` [Patch v2 2/2] net: usbnet: " Phong Tran
2019-11-26 22:04       ` [Patch v2 0/2] Fix -Wcast-function-type usb net drivers David Miller

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git