Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type
@ 2019-11-25 15:02 Phong Tran
  2019-11-25 15:02 ` [PATCH 2/3] drivers: net: intel: " Phong Tran
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Phong Tran @ 2019-11-25 15:02 UTC (permalink / raw)
  To: jakub.kicinski, kvalo, davem, luciano.coelho, shahar.s.matityahu,
	johannes.berg, emmanuel.grumbach, sara.sharon, Larry.Finger,
	yhchuang, yuehaibing, pkshih, arend.vanspriel, rafal, franky.lin,
	pieter-paul.giesberts, p.figiel, Wright.Feng, keescook
  Cc: linux-wireless, 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/wireless/broadcom/b43legacy/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43legacy/main.c b/drivers/net/wireless/broadcom/b43legacy/main.c
index 4325e91736eb..8b6b657c4b85 100644
--- a/drivers/net/wireless/broadcom/b43legacy/main.c
+++ b/drivers/net/wireless/broadcom/b43legacy/main.c
@@ -1275,8 +1275,9 @@ static void handle_irq_ucode_debug(struct b43legacy_wldev *dev)
 }
 
 /* Interrupt handler bottom-half */
-static void b43legacy_interrupt_tasklet(struct b43legacy_wldev *dev)
+static void b43legacy_interrupt_tasklet(unsigned long data)
 {
+	struct b43legacy_wldev *dev = (struct b43legacy_wldev *)data;
 	u32 reason;
 	u32 dma_reason[ARRAY_SIZE(dev->dma_reason)];
 	u32 merged_dma_reason = 0;
@@ -3741,7 +3742,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev,
 	b43legacy_set_status(wldev, B43legacy_STAT_UNINIT);
 	wldev->bad_frames_preempt = modparam_bad_frames_preempt;
 	tasklet_init(&wldev->isr_tasklet,
-		     (void (*)(unsigned long))b43legacy_interrupt_tasklet,
+		     b43legacy_interrupt_tasklet,
 		     (unsigned long)wldev);
 	if (modparam_pio)
 		wldev->__using_pio = true;
-- 
2.20.1


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

* [PATCH 2/3] drivers: net: intel: Fix -Wcast-function-type
  2019-11-25 15:02 [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type Phong Tran
@ 2019-11-25 15:02 ` " Phong Tran
  2019-11-25 17:30   ` Larry Finger
  2019-11-25 15:02 ` [PATCH 3/3] drivers: net: realtek: " Phong Tran
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 18+ messages in thread
From: Phong Tran @ 2019-11-25 15:02 UTC (permalink / raw)
  To: jakub.kicinski, kvalo, davem, luciano.coelho, shahar.s.matityahu,
	johannes.berg, emmanuel.grumbach, sara.sharon, Larry.Finger,
	yhchuang, yuehaibing, pkshih, arend.vanspriel, rafal, franky.lin,
	pieter-paul.giesberts, p.figiel, Wright.Feng, keescook
  Cc: linux-wireless, 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/wireless/intel/ipw2x00/ipw2100.c   | 7 ++++---
 drivers/net/wireless/intel/ipw2x00/ipw2200.c   | 5 +++--
 drivers/net/wireless/intel/iwlegacy/3945-mac.c | 5 +++--
 drivers/net/wireless/intel/iwlegacy/4965-mac.c | 5 +++--
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
index 8dfbaff2d1fe..a162146a43a7 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
@@ -3206,8 +3206,9 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
 	}
 }
 
-static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
+static void ipw2100_irq_tasklet(unsigned long data)
 {
+	struct ipw2100_priv *priv = (struct ipw2100_priv *)data;
 	struct net_device *dev = priv->net_dev;
 	unsigned long flags;
 	u32 inta, tmp;
@@ -6007,7 +6008,7 @@ static void ipw2100_rf_kill(struct work_struct *work)
 	spin_unlock_irqrestore(&priv->low_lock, flags);
 }
 
-static void ipw2100_irq_tasklet(struct ipw2100_priv *priv);
+static void ipw2100_irq_tasklet(unsigned long data);
 
 static const struct net_device_ops ipw2100_netdev_ops = {
 	.ndo_open		= ipw2100_open,
@@ -6137,7 +6138,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
 	INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
 	INIT_DELAYED_WORK(&priv->scan_event, ipw2100_scan_event);
 
-	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
+	tasklet_init(&priv->irq_tasklet,
 		     ipw2100_irq_tasklet, (unsigned long)priv);
 
 	/* NOTE:  We do not start the deferred work for status checks yet */
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
index ed0f06532d5e..ac5f797fb1ad 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
@@ -1945,8 +1945,9 @@ static void notify_wx_assoc_event(struct ipw_priv *priv)
 	wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
 }
 
-static void ipw_irq_tasklet(struct ipw_priv *priv)
+static void ipw_irq_tasklet(unsigned long data)
 {
+	struct ipw_priv *priv = (struct ipw_priv *)data;
 	u32 inta, inta_mask, handled = 0;
 	unsigned long flags;
 	int rc = 0;
@@ -10680,7 +10681,7 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv)
 	INIT_WORK(&priv->qos_activate, ipw_bg_qos_activate);
 #endif				/* CONFIG_IPW2200_QOS */
 
-	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
+	tasklet_init(&priv->irq_tasklet,
 		     ipw_irq_tasklet, (unsigned long)priv);
 
 	return ret;
diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
index 4fbcc7fba3cc..e2e9c3e8fff5 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
@@ -1376,8 +1376,9 @@ il3945_dump_nic_error_log(struct il_priv *il)
 }
 
 static void
-il3945_irq_tasklet(struct il_priv *il)
+il3945_irq_tasklet(unsigned long data)
 {
+	struct il_priv *il = (struct il_priv *)data;
 	u32 inta, handled = 0;
 	u32 inta_fh;
 	unsigned long flags;
@@ -3403,7 +3404,7 @@ il3945_setup_deferred_work(struct il_priv *il)
 	timer_setup(&il->watchdog, il_bg_watchdog, 0);
 
 	tasklet_init(&il->irq_tasklet,
-		     (void (*)(unsigned long))il3945_irq_tasklet,
+		     il3945_irq_tasklet,
 		     (unsigned long)il);
 }
 
diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index ffb705b18fb1..5fe17039a337 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -4344,8 +4344,9 @@ il4965_synchronize_irq(struct il_priv *il)
 }
 
 static void
-il4965_irq_tasklet(struct il_priv *il)
+il4965_irq_tasklet(unsigned long data)
 {
+	struct il_priv *il = (struct il_priv *)data;
 	u32 inta, handled = 0;
 	u32 inta_fh;
 	unsigned long flags;
@@ -6238,7 +6239,7 @@ il4965_setup_deferred_work(struct il_priv *il)
 	timer_setup(&il->watchdog, il_bg_watchdog, 0);
 
 	tasklet_init(&il->irq_tasklet,
-		     (void (*)(unsigned long))il4965_irq_tasklet,
+		     il4965_irq_tasklet,
 		     (unsigned long)il);
 }
 
-- 
2.20.1


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

* [PATCH 3/3] drivers: net: realtek: Fix -Wcast-function-type
  2019-11-25 15:02 [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type Phong Tran
  2019-11-25 15:02 ` [PATCH 2/3] drivers: net: intel: " Phong Tran
@ 2019-11-25 15:02 ` " Phong Tran
  2019-11-25 17:33   ` Larry Finger
  2019-11-25 17:26 ` [PATCH 1/3] drivers: net: b43legacy: " Larry Finger
  2019-11-26 17:55 ` [Patch v2 0/4] wireless: " Phong Tran
  3 siblings, 1 reply; 18+ messages in thread
From: Phong Tran @ 2019-11-25 15:02 UTC (permalink / raw)
  To: jakub.kicinski, kvalo, davem, luciano.coelho, shahar.s.matityahu,
	johannes.berg, emmanuel.grumbach, sara.sharon, Larry.Finger,
	yhchuang, yuehaibing, pkshih, arend.vanspriel, rafal, franky.lin,
	pieter-paul.giesberts, p.figiel, Wright.Feng, keescook
  Cc: linux-wireless, 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/wireless/realtek/rtlwifi/pci.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index f88d26535978..25335bd2873b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -1061,13 +1061,15 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
 	return ret;
 }
 
-static void _rtl_pci_irq_tasklet(struct ieee80211_hw *hw)
+static void _rtl_pci_irq_tasklet(unsigned long data)
 {
+	struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
 	_rtl_pci_tx_chk_waitq(hw);
 }
 
-static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
+static void _rtl_pci_prepare_bcn_tasklet(unsigned long data)
 {
+	struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -1193,10 +1195,10 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw,
 
 	/*task */
 	tasklet_init(&rtlpriv->works.irq_tasklet,
-		     (void (*)(unsigned long))_rtl_pci_irq_tasklet,
+		     _rtl_pci_irq_tasklet,
 		     (unsigned long)hw);
 	tasklet_init(&rtlpriv->works.irq_prepare_bcn_tasklet,
-		     (void (*)(unsigned long))_rtl_pci_prepare_bcn_tasklet,
+		     _rtl_pci_prepare_bcn_tasklet,
 		     (unsigned long)hw);
 	INIT_WORK(&rtlpriv->works.lps_change_work,
 		  rtl_lps_change_work_callback);
-- 
2.20.1


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

* Re: [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type
  2019-11-25 15:02 [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type Phong Tran
  2019-11-25 15:02 ` [PATCH 2/3] drivers: net: intel: " Phong Tran
  2019-11-25 15:02 ` [PATCH 3/3] drivers: net: realtek: " Phong Tran
@ 2019-11-25 17:26 ` " Larry Finger
  2019-11-25 17:28   ` Jakub Kicinski
  2019-11-25 17:29   ` Kalle Valo
  2019-11-26 17:55 ` [Patch v2 0/4] wireless: " Phong Tran
  3 siblings, 2 replies; 18+ messages in thread
From: Larry Finger @ 2019-11-25 17:26 UTC (permalink / raw)
  To: Phong Tran, jakub.kicinski, kvalo, davem, luciano.coelho,
	shahar.s.matityahu, johannes.berg, emmanuel.grumbach,
	sara.sharon, yhchuang, yuehaibing, pkshih, arend.vanspriel,
	rafal, franky.lin, pieter-paul.giesberts, p.figiel, Wright.Feng,
	keescook
  Cc: linux-wireless, netdev, linux-kernel

On 11/25/19 9:02 AM, Phong Tran wrote:
> 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>
> ---

This patch was submitted yesterday as "[PATCH 3/5] drivers: net: b43legacy: Fix 
-Wcast-function-type". Why was it submitted twice?

Larry

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

* Re: [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type
  2019-11-25 17:26 ` [PATCH 1/3] drivers: net: b43legacy: " Larry Finger
@ 2019-11-25 17:28   ` Jakub Kicinski
  2019-11-25 17:29   ` Kalle Valo
  1 sibling, 0 replies; 18+ messages in thread
From: Jakub Kicinski @ 2019-11-25 17:28 UTC (permalink / raw)
  To: Larry Finger, Phong Tran
  Cc: kvalo, davem, luciano.coelho, shahar.s.matityahu, johannes.berg,
	emmanuel.grumbach, sara.sharon, yhchuang, yuehaibing, pkshih,
	arend.vanspriel, rafal, franky.lin, pieter-paul.giesberts,
	p.figiel, Wright.Feng, keescook, linux-wireless, netdev,
	linux-kernel

On Mon, 25 Nov 2019 11:26:31 -0600, Larry Finger wrote:
> On 11/25/19 9:02 AM, Phong Tran wrote:
> > 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>
> > ---  
> 
> This patch was submitted yesterday as "[PATCH 3/5] drivers: net: b43legacy: Fix 
> -Wcast-function-type". Why was it submitted twice?

Because the series was split between wireless and netdev changes.
Tran, please make sure you include a note about the reason for reposting
in the cover letter.

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

* Re: [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type
  2019-11-25 17:26 ` [PATCH 1/3] drivers: net: b43legacy: " Larry Finger
  2019-11-25 17:28   ` Jakub Kicinski
@ 2019-11-25 17:29   ` Kalle Valo
  1 sibling, 0 replies; 18+ messages in thread
From: Kalle Valo @ 2019-11-25 17:29 UTC (permalink / raw)
  To: Larry Finger
  Cc: Phong Tran, jakub.kicinski, davem, luciano.coelho,
	shahar.s.matityahu, johannes.berg, emmanuel.grumbach,
	sara.sharon, yhchuang, yuehaibing, pkshih, arend.vanspriel,
	rafal, franky.lin, pieter-paul.giesberts, p.figiel, Wright.Feng,
	keescook, linux-wireless, netdev, linux-kernel

Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 11/25/19 9:02 AM, Phong Tran wrote:
>> 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>
>> ---
>
> This patch was submitted yesterday as "[PATCH 3/5] drivers: net:
> b43legacy: Fix -Wcast-function-type". Why was it submitted twice?

Jakub asked to split them:

https://patchwork.kernel.org/cover/11259087/

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH 2/3] drivers: net: intel: Fix -Wcast-function-type
  2019-11-25 15:02 ` [PATCH 2/3] drivers: net: intel: " Phong Tran
@ 2019-11-25 17:30   ` Larry Finger
  2019-11-25 17:56     ` Kalle Valo
  0 siblings, 1 reply; 18+ messages in thread
From: Larry Finger @ 2019-11-25 17:30 UTC (permalink / raw)
  To: Phong Tran, jakub.kicinski, kvalo, davem, luciano.coelho,
	shahar.s.matityahu, johannes.berg, emmanuel.grumbach,
	sara.sharon, yhchuang, yuehaibing, pkshih, arend.vanspriel,
	rafal, franky.lin, pieter-paul.giesberts, p.figiel, Wright.Feng,
	keescook
  Cc: linux-wireless, netdev, linux-kernel

On 11/25/19 9:02 AM, Phong Tran wrote:
> 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/wireless/intel/ipw2x00/ipw2100.c   | 7 ++++---
>   drivers/net/wireless/intel/ipw2x00/ipw2200.c   | 5 +++--
>   drivers/net/wireless/intel/iwlegacy/3945-mac.c | 5 +++--
>   drivers/net/wireless/intel/iwlegacy/4965-mac.c | 5 +++--
>   4 files changed, 13 insertions(+), 9 deletions(-)

This patch is "fixing" three different drivers and should be split into at least 
two parts. To be consistent with previous practices, the subject for the two 
should be "intel: ipw2100: ...." and "intel: iwlegacy: ...."

Larry

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

* Re: [PATCH 3/3] drivers: net: realtek: Fix -Wcast-function-type
  2019-11-25 15:02 ` [PATCH 3/3] drivers: net: realtek: " Phong Tran
@ 2019-11-25 17:33   ` Larry Finger
  0 siblings, 0 replies; 18+ messages in thread
From: Larry Finger @ 2019-11-25 17:33 UTC (permalink / raw)
  To: Phong Tran, jakub.kicinski, kvalo, davem, luciano.coelho,
	shahar.s.matityahu, johannes.berg, emmanuel.grumbach,
	sara.sharon, yhchuang, yuehaibing, pkshih, arend.vanspriel,
	rafal, franky.lin, pieter-paul.giesberts, p.figiel, Wright.Feng,
	keescook
  Cc: linux-wireless, netdev, linux-kernel

On 11/25/19 9:02 AM, Phong Tran wrote:
> 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/wireless/realtek/rtlwifi/pci.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 

I have not yet tested this patch, but it looks to be OK; however, for 
consistency, the subject should be "rtlwifi: ....".

Larry

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

* Re: [PATCH 2/3] drivers: net: intel: Fix -Wcast-function-type
  2019-11-25 17:30   ` Larry Finger
@ 2019-11-25 17:56     ` Kalle Valo
  0 siblings, 0 replies; 18+ messages in thread
From: Kalle Valo @ 2019-11-25 17:56 UTC (permalink / raw)
  To: Larry Finger
  Cc: Phong Tran, jakub.kicinski, davem, luciano.coelho,
	shahar.s.matityahu, johannes.berg, emmanuel.grumbach,
	sara.sharon, yhchuang, yuehaibing, pkshih, arend.vanspriel,
	rafal, franky.lin, pieter-paul.giesberts, p.figiel, Wright.Feng,
	keescook, linux-wireless, netdev, linux-kernel

Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 11/25/19 9:02 AM, Phong Tran wrote:
>> 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/wireless/intel/ipw2x00/ipw2100.c   | 7 ++++---
>>   drivers/net/wireless/intel/ipw2x00/ipw2200.c   | 5 +++--
>>   drivers/net/wireless/intel/iwlegacy/3945-mac.c | 5 +++--
>>   drivers/net/wireless/intel/iwlegacy/4965-mac.c | 5 +++--
>>   4 files changed, 13 insertions(+), 9 deletions(-)
>
> This patch is "fixing" three different drivers and should be split
> into at least two parts. To be consistent with previous practices, the
> subject for the two should be "intel: ipw2100: ...." and "intel:
> iwlegacy: ...."

Actually, please drop even "intel:". So "ipw2x00: " and "iwlegacy: " is
enough.


-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* [Patch v2 0/4] wireless: Fix -Wcast-function-type 
  2019-11-25 15:02 [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type Phong Tran
                   ` (2 preceding siblings ...)
  2019-11-25 17:26 ` [PATCH 1/3] drivers: net: b43legacy: " Larry Finger
@ 2019-11-26 17:55 ` " Phong Tran
  2019-11-26 17:55   ` [Patch v2 1/4] b43legacy: " Phong Tran
                     ` (3 more replies)
  3 siblings, 4 replies; 18+ messages in thread
From: Phong Tran @ 2019-11-26 17:55 UTC (permalink / raw)
  To: Larry.Finger, jakub.kicinski, kvalo
  Cc: tranmanphong, Wright.Feng, arend.vanspriel, davem,
	emmanuel.grumbach, franky.lin, johannes.berg, keescook,
	linux-kernel, linux-wireless, luciano.coelho, netdev, p.figiel,
	pieter-paul.giesberts, pkshih, rafal, sara.sharon,
	shahar.s.matityahu, yhchuang, yuehaibing

Change with v1:
 - align commit subject prefix with review comments.
 - split patch "drivers: net: intel: Fix -Wcast-function-type"
   into "ipw2x00" and "iwlegacy"
 - update tested by as
https://lore.kernel.org/linux-wireless/8eb8d6fd-de20-2d04-8210-ad8304d7da9e@lwfinger.net/

Phong Tran (4):
  b43legacy: Fix -Wcast-function-type
  ipw2x00: Fix -Wcast-function-type
  iwlegacy: Fix -Wcast-function-type
  rtlwifi: rtl_pci: Fix -Wcast-function-type

 drivers/net/wireless/broadcom/b43legacy/main.c |  5 +++--
 drivers/net/wireless/intel/ipw2x00/ipw2100.c   |  7 ++++---
 drivers/net/wireless/intel/ipw2x00/ipw2200.c   |  5 +++--
 drivers/net/wireless/intel/iwlegacy/3945-mac.c |  5 +++--
 drivers/net/wireless/intel/iwlegacy/4965-mac.c |  5 +++--
 drivers/net/wireless/realtek/rtlwifi/pci.c     | 10 ++++++----
 6 files changed, 22 insertions(+), 15 deletions(-)

-- 
2.20.1


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

* [Patch v2 1/4] b43legacy: Fix -Wcast-function-type
  2019-11-26 17:55 ` [Patch v2 0/4] wireless: " Phong Tran
@ 2019-11-26 17:55   ` " Phong Tran
  2019-11-27  5:05     ` Kees Cook
  2019-11-26 17:55   ` [Patch v2 2/4] ipw2x00: " Phong Tran
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 18+ messages in thread
From: Phong Tran @ 2019-11-26 17:55 UTC (permalink / raw)
  To: Larry.Finger, jakub.kicinski, kvalo
  Cc: tranmanphong, Wright.Feng, arend.vanspriel, davem,
	emmanuel.grumbach, franky.lin, johannes.berg, keescook,
	linux-kernel, linux-wireless, luciano.coelho, netdev, p.figiel,
	pieter-paul.giesberts, pkshih, rafal, sara.sharon,
	shahar.s.matityahu, yhchuang, yuehaibing

correct usage prototype of callback in tasklet_init().
Report by https://github.com/KSPP/linux/issues/20

Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/net/wireless/broadcom/b43legacy/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43legacy/main.c b/drivers/net/wireless/broadcom/b43legacy/main.c
index 4325e91736eb..8b6b657c4b85 100644
--- a/drivers/net/wireless/broadcom/b43legacy/main.c
+++ b/drivers/net/wireless/broadcom/b43legacy/main.c
@@ -1275,8 +1275,9 @@ static void handle_irq_ucode_debug(struct b43legacy_wldev *dev)
 }
 
 /* Interrupt handler bottom-half */
-static void b43legacy_interrupt_tasklet(struct b43legacy_wldev *dev)
+static void b43legacy_interrupt_tasklet(unsigned long data)
 {
+	struct b43legacy_wldev *dev = (struct b43legacy_wldev *)data;
 	u32 reason;
 	u32 dma_reason[ARRAY_SIZE(dev->dma_reason)];
 	u32 merged_dma_reason = 0;
@@ -3741,7 +3742,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev,
 	b43legacy_set_status(wldev, B43legacy_STAT_UNINIT);
 	wldev->bad_frames_preempt = modparam_bad_frames_preempt;
 	tasklet_init(&wldev->isr_tasklet,
-		     (void (*)(unsigned long))b43legacy_interrupt_tasklet,
+		     b43legacy_interrupt_tasklet,
 		     (unsigned long)wldev);
 	if (modparam_pio)
 		wldev->__using_pio = true;
-- 
2.20.1


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

* [Patch v2 2/4] ipw2x00: Fix -Wcast-function-type
  2019-11-26 17:55 ` [Patch v2 0/4] wireless: " Phong Tran
  2019-11-26 17:55   ` [Patch v2 1/4] b43legacy: " Phong Tran
@ 2019-11-26 17:55   ` " Phong Tran
  2019-11-27  5:05     ` Kees Cook
  2019-11-26 17:55   ` [Patch v2 3/4] iwlegacy: " Phong Tran
  2019-11-26 17:55   ` [Patch v2 4/4] rtlwifi: rtl_pci: " Phong Tran
  3 siblings, 1 reply; 18+ messages in thread
From: Phong Tran @ 2019-11-26 17:55 UTC (permalink / raw)
  To: Larry.Finger, jakub.kicinski, kvalo
  Cc: tranmanphong, Wright.Feng, arend.vanspriel, davem,
	emmanuel.grumbach, franky.lin, johannes.berg, keescook,
	linux-kernel, linux-wireless, luciano.coelho, netdev, p.figiel,
	pieter-paul.giesberts, pkshih, rafal, sara.sharon,
	shahar.s.matityahu, yhchuang, yuehaibing

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/wireless/intel/ipw2x00/ipw2100.c | 7 ++++---
 drivers/net/wireless/intel/ipw2x00/ipw2200.c | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
index 8dfbaff2d1fe..a162146a43a7 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
@@ -3206,8 +3206,9 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
 	}
 }
 
-static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
+static void ipw2100_irq_tasklet(unsigned long data)
 {
+	struct ipw2100_priv *priv = (struct ipw2100_priv *)data;
 	struct net_device *dev = priv->net_dev;
 	unsigned long flags;
 	u32 inta, tmp;
@@ -6007,7 +6008,7 @@ static void ipw2100_rf_kill(struct work_struct *work)
 	spin_unlock_irqrestore(&priv->low_lock, flags);
 }
 
-static void ipw2100_irq_tasklet(struct ipw2100_priv *priv);
+static void ipw2100_irq_tasklet(unsigned long data);
 
 static const struct net_device_ops ipw2100_netdev_ops = {
 	.ndo_open		= ipw2100_open,
@@ -6137,7 +6138,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
 	INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
 	INIT_DELAYED_WORK(&priv->scan_event, ipw2100_scan_event);
 
-	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
+	tasklet_init(&priv->irq_tasklet,
 		     ipw2100_irq_tasklet, (unsigned long)priv);
 
 	/* NOTE:  We do not start the deferred work for status checks yet */
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
index ed0f06532d5e..ac5f797fb1ad 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
@@ -1945,8 +1945,9 @@ static void notify_wx_assoc_event(struct ipw_priv *priv)
 	wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
 }
 
-static void ipw_irq_tasklet(struct ipw_priv *priv)
+static void ipw_irq_tasklet(unsigned long data)
 {
+	struct ipw_priv *priv = (struct ipw_priv *)data;
 	u32 inta, inta_mask, handled = 0;
 	unsigned long flags;
 	int rc = 0;
@@ -10680,7 +10681,7 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv)
 	INIT_WORK(&priv->qos_activate, ipw_bg_qos_activate);
 #endif				/* CONFIG_IPW2200_QOS */
 
-	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
+	tasklet_init(&priv->irq_tasklet,
 		     ipw_irq_tasklet, (unsigned long)priv);
 
 	return ret;
-- 
2.20.1


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

* [Patch v2 3/4] iwlegacy: Fix -Wcast-function-type
  2019-11-26 17:55 ` [Patch v2 0/4] wireless: " Phong Tran
  2019-11-26 17:55   ` [Patch v2 1/4] b43legacy: " Phong Tran
  2019-11-26 17:55   ` [Patch v2 2/4] ipw2x00: " Phong Tran
@ 2019-11-26 17:55   ` " Phong Tran
  2019-11-27  5:05     ` Kees Cook
  2019-11-26 17:55   ` [Patch v2 4/4] rtlwifi: rtl_pci: " Phong Tran
  3 siblings, 1 reply; 18+ messages in thread
From: Phong Tran @ 2019-11-26 17:55 UTC (permalink / raw)
  To: Larry.Finger, jakub.kicinski, kvalo
  Cc: tranmanphong, Wright.Feng, arend.vanspriel, davem,
	emmanuel.grumbach, franky.lin, johannes.berg, keescook,
	linux-kernel, linux-wireless, luciano.coelho, netdev, p.figiel,
	pieter-paul.giesberts, pkshih, rafal, sara.sharon,
	shahar.s.matityahu, yhchuang, yuehaibing

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/wireless/intel/iwlegacy/3945-mac.c | 5 +++--
 drivers/net/wireless/intel/iwlegacy/4965-mac.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
index 4fbcc7fba3cc..e2e9c3e8fff5 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
@@ -1376,8 +1376,9 @@ il3945_dump_nic_error_log(struct il_priv *il)
 }
 
 static void
-il3945_irq_tasklet(struct il_priv *il)
+il3945_irq_tasklet(unsigned long data)
 {
+	struct il_priv *il = (struct il_priv *)data;
 	u32 inta, handled = 0;
 	u32 inta_fh;
 	unsigned long flags;
@@ -3403,7 +3404,7 @@ il3945_setup_deferred_work(struct il_priv *il)
 	timer_setup(&il->watchdog, il_bg_watchdog, 0);
 
 	tasklet_init(&il->irq_tasklet,
-		     (void (*)(unsigned long))il3945_irq_tasklet,
+		     il3945_irq_tasklet,
 		     (unsigned long)il);
 }
 
diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index ffb705b18fb1..5fe17039a337 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -4344,8 +4344,9 @@ il4965_synchronize_irq(struct il_priv *il)
 }
 
 static void
-il4965_irq_tasklet(struct il_priv *il)
+il4965_irq_tasklet(unsigned long data)
 {
+	struct il_priv *il = (struct il_priv *)data;
 	u32 inta, handled = 0;
 	u32 inta_fh;
 	unsigned long flags;
@@ -6238,7 +6239,7 @@ il4965_setup_deferred_work(struct il_priv *il)
 	timer_setup(&il->watchdog, il_bg_watchdog, 0);
 
 	tasklet_init(&il->irq_tasklet,
-		     (void (*)(unsigned long))il4965_irq_tasklet,
+		     il4965_irq_tasklet,
 		     (unsigned long)il);
 }
 
-- 
2.20.1


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

* [Patch v2 4/4] rtlwifi: rtl_pci: Fix -Wcast-function-type
  2019-11-26 17:55 ` [Patch v2 0/4] wireless: " Phong Tran
                     ` (2 preceding siblings ...)
  2019-11-26 17:55   ` [Patch v2 3/4] iwlegacy: " Phong Tran
@ 2019-11-26 17:55   ` " Phong Tran
  2019-11-27  5:05     ` Kees Cook
  3 siblings, 1 reply; 18+ messages in thread
From: Phong Tran @ 2019-11-26 17:55 UTC (permalink / raw)
  To: Larry.Finger, jakub.kicinski, kvalo
  Cc: tranmanphong, Wright.Feng, arend.vanspriel, davem,
	emmanuel.grumbach, franky.lin, johannes.berg, keescook,
	linux-kernel, linux-wireless, luciano.coelho, netdev, p.figiel,
	pieter-paul.giesberts, pkshih, rafal, sara.sharon,
	shahar.s.matityahu, yhchuang, yuehaibing

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/wireless/realtek/rtlwifi/pci.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index f88d26535978..25335bd2873b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -1061,13 +1061,15 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
 	return ret;
 }
 
-static void _rtl_pci_irq_tasklet(struct ieee80211_hw *hw)
+static void _rtl_pci_irq_tasklet(unsigned long data)
 {
+	struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
 	_rtl_pci_tx_chk_waitq(hw);
 }
 
-static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
+static void _rtl_pci_prepare_bcn_tasklet(unsigned long data)
 {
+	struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -1193,10 +1195,10 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw,
 
 	/*task */
 	tasklet_init(&rtlpriv->works.irq_tasklet,
-		     (void (*)(unsigned long))_rtl_pci_irq_tasklet,
+		     _rtl_pci_irq_tasklet,
 		     (unsigned long)hw);
 	tasklet_init(&rtlpriv->works.irq_prepare_bcn_tasklet,
-		     (void (*)(unsigned long))_rtl_pci_prepare_bcn_tasklet,
+		     _rtl_pci_prepare_bcn_tasklet,
 		     (unsigned long)hw);
 	INIT_WORK(&rtlpriv->works.lps_change_work,
 		  rtl_lps_change_work_callback);
-- 
2.20.1


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

* Re: [Patch v2 1/4] b43legacy: Fix -Wcast-function-type
  2019-11-26 17:55   ` [Patch v2 1/4] b43legacy: " Phong Tran
@ 2019-11-27  5:05     ` Kees Cook
  0 siblings, 0 replies; 18+ messages in thread
From: Kees Cook @ 2019-11-27  5:05 UTC (permalink / raw)
  To: Phong Tran
  Cc: Larry.Finger, jakub.kicinski, kvalo, Wright.Feng,
	arend.vanspriel, davem, emmanuel.grumbach, franky.lin,
	johannes.berg, linux-kernel, linux-wireless, luciano.coelho,
	netdev, p.figiel, pieter-paul.giesberts, pkshih, rafal,
	sara.sharon, shahar.s.matityahu, yhchuang, yuehaibing

On Wed, Nov 27, 2019 at 12:55:26AM +0700, Phong Tran wrote:
> correct usage prototype of callback in tasklet_init().
> Report by https://github.com/KSPP/linux/issues/20
> 
> Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: Phong Tran <tranmanphong@gmail.com>

Thanks for sending these!

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/net/wireless/broadcom/b43legacy/main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/broadcom/b43legacy/main.c b/drivers/net/wireless/broadcom/b43legacy/main.c
> index 4325e91736eb..8b6b657c4b85 100644
> --- a/drivers/net/wireless/broadcom/b43legacy/main.c
> +++ b/drivers/net/wireless/broadcom/b43legacy/main.c
> @@ -1275,8 +1275,9 @@ static void handle_irq_ucode_debug(struct b43legacy_wldev *dev)
>  }
>  
>  /* Interrupt handler bottom-half */
> -static void b43legacy_interrupt_tasklet(struct b43legacy_wldev *dev)
> +static void b43legacy_interrupt_tasklet(unsigned long data)
>  {
> +	struct b43legacy_wldev *dev = (struct b43legacy_wldev *)data;
>  	u32 reason;
>  	u32 dma_reason[ARRAY_SIZE(dev->dma_reason)];
>  	u32 merged_dma_reason = 0;
> @@ -3741,7 +3742,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev,
>  	b43legacy_set_status(wldev, B43legacy_STAT_UNINIT);
>  	wldev->bad_frames_preempt = modparam_bad_frames_preempt;
>  	tasklet_init(&wldev->isr_tasklet,
> -		     (void (*)(unsigned long))b43legacy_interrupt_tasklet,
> +		     b43legacy_interrupt_tasklet,
>  		     (unsigned long)wldev);
>  	if (modparam_pio)
>  		wldev->__using_pio = true;
> -- 
> 2.20.1
> 

-- 
Kees Cook

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

* Re: [Patch v2 2/4] ipw2x00: Fix -Wcast-function-type
  2019-11-26 17:55   ` [Patch v2 2/4] ipw2x00: " Phong Tran
@ 2019-11-27  5:05     ` Kees Cook
  0 siblings, 0 replies; 18+ messages in thread
From: Kees Cook @ 2019-11-27  5:05 UTC (permalink / raw)
  To: Phong Tran
  Cc: Larry.Finger, jakub.kicinski, kvalo, Wright.Feng,
	arend.vanspriel, davem, emmanuel.grumbach, franky.lin,
	johannes.berg, linux-kernel, linux-wireless, luciano.coelho,
	netdev, p.figiel, pieter-paul.giesberts, pkshih, rafal,
	sara.sharon, shahar.s.matityahu, yhchuang, yuehaibing

On Wed, Nov 27, 2019 at 12:55:27AM +0700, Phong Tran wrote:
> 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>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/net/wireless/intel/ipw2x00/ipw2100.c | 7 ++++---
>  drivers/net/wireless/intel/ipw2x00/ipw2200.c | 5 +++--
>  2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
> index 8dfbaff2d1fe..a162146a43a7 100644
> --- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
> @@ -3206,8 +3206,9 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
>  	}
>  }
>  
> -static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
> +static void ipw2100_irq_tasklet(unsigned long data)
>  {
> +	struct ipw2100_priv *priv = (struct ipw2100_priv *)data;
>  	struct net_device *dev = priv->net_dev;
>  	unsigned long flags;
>  	u32 inta, tmp;
> @@ -6007,7 +6008,7 @@ static void ipw2100_rf_kill(struct work_struct *work)
>  	spin_unlock_irqrestore(&priv->low_lock, flags);
>  }
>  
> -static void ipw2100_irq_tasklet(struct ipw2100_priv *priv);
> +static void ipw2100_irq_tasklet(unsigned long data);
>  
>  static const struct net_device_ops ipw2100_netdev_ops = {
>  	.ndo_open		= ipw2100_open,
> @@ -6137,7 +6138,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
>  	INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
>  	INIT_DELAYED_WORK(&priv->scan_event, ipw2100_scan_event);
>  
> -	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
> +	tasklet_init(&priv->irq_tasklet,
>  		     ipw2100_irq_tasklet, (unsigned long)priv);
>  
>  	/* NOTE:  We do not start the deferred work for status checks yet */
> diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> index ed0f06532d5e..ac5f797fb1ad 100644
> --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> @@ -1945,8 +1945,9 @@ static void notify_wx_assoc_event(struct ipw_priv *priv)
>  	wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
>  }
>  
> -static void ipw_irq_tasklet(struct ipw_priv *priv)
> +static void ipw_irq_tasklet(unsigned long data)
>  {
> +	struct ipw_priv *priv = (struct ipw_priv *)data;
>  	u32 inta, inta_mask, handled = 0;
>  	unsigned long flags;
>  	int rc = 0;
> @@ -10680,7 +10681,7 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv)
>  	INIT_WORK(&priv->qos_activate, ipw_bg_qos_activate);
>  #endif				/* CONFIG_IPW2200_QOS */
>  
> -	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
> +	tasklet_init(&priv->irq_tasklet,
>  		     ipw_irq_tasklet, (unsigned long)priv);
>  
>  	return ret;
> -- 
> 2.20.1
> 

-- 
Kees Cook

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

* Re: [Patch v2 3/4] iwlegacy: Fix -Wcast-function-type
  2019-11-26 17:55   ` [Patch v2 3/4] iwlegacy: " Phong Tran
@ 2019-11-27  5:05     ` Kees Cook
  0 siblings, 0 replies; 18+ messages in thread
From: Kees Cook @ 2019-11-27  5:05 UTC (permalink / raw)
  To: Phong Tran
  Cc: Larry.Finger, jakub.kicinski, kvalo, Wright.Feng,
	arend.vanspriel, davem, emmanuel.grumbach, franky.lin,
	johannes.berg, linux-kernel, linux-wireless, luciano.coelho,
	netdev, p.figiel, pieter-paul.giesberts, pkshih, rafal,
	sara.sharon, shahar.s.matityahu, yhchuang, yuehaibing

On Wed, Nov 27, 2019 at 12:55:28AM +0700, Phong Tran wrote:
> 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>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/net/wireless/intel/iwlegacy/3945-mac.c | 5 +++--
>  drivers/net/wireless/intel/iwlegacy/4965-mac.c | 5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> index 4fbcc7fba3cc..e2e9c3e8fff5 100644
> --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> @@ -1376,8 +1376,9 @@ il3945_dump_nic_error_log(struct il_priv *il)
>  }
>  
>  static void
> -il3945_irq_tasklet(struct il_priv *il)
> +il3945_irq_tasklet(unsigned long data)
>  {
> +	struct il_priv *il = (struct il_priv *)data;
>  	u32 inta, handled = 0;
>  	u32 inta_fh;
>  	unsigned long flags;
> @@ -3403,7 +3404,7 @@ il3945_setup_deferred_work(struct il_priv *il)
>  	timer_setup(&il->watchdog, il_bg_watchdog, 0);
>  
>  	tasklet_init(&il->irq_tasklet,
> -		     (void (*)(unsigned long))il3945_irq_tasklet,
> +		     il3945_irq_tasklet,
>  		     (unsigned long)il);
>  }
>  
> diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
> index ffb705b18fb1..5fe17039a337 100644
> --- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
> +++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
> @@ -4344,8 +4344,9 @@ il4965_synchronize_irq(struct il_priv *il)
>  }
>  
>  static void
> -il4965_irq_tasklet(struct il_priv *il)
> +il4965_irq_tasklet(unsigned long data)
>  {
> +	struct il_priv *il = (struct il_priv *)data;
>  	u32 inta, handled = 0;
>  	u32 inta_fh;
>  	unsigned long flags;
> @@ -6238,7 +6239,7 @@ il4965_setup_deferred_work(struct il_priv *il)
>  	timer_setup(&il->watchdog, il_bg_watchdog, 0);
>  
>  	tasklet_init(&il->irq_tasklet,
> -		     (void (*)(unsigned long))il4965_irq_tasklet,
> +		     il4965_irq_tasklet,
>  		     (unsigned long)il);
>  }
>  
> -- 
> 2.20.1
> 

-- 
Kees Cook

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

* Re: [Patch v2 4/4] rtlwifi: rtl_pci: Fix -Wcast-function-type
  2019-11-26 17:55   ` [Patch v2 4/4] rtlwifi: rtl_pci: " Phong Tran
@ 2019-11-27  5:05     ` Kees Cook
  0 siblings, 0 replies; 18+ messages in thread
From: Kees Cook @ 2019-11-27  5:05 UTC (permalink / raw)
  To: Phong Tran
  Cc: Larry.Finger, jakub.kicinski, kvalo, Wright.Feng,
	arend.vanspriel, davem, emmanuel.grumbach, franky.lin,
	johannes.berg, linux-kernel, linux-wireless, luciano.coelho,
	netdev, p.figiel, pieter-paul.giesberts, pkshih, rafal,
	sara.sharon, shahar.s.matityahu, yhchuang, yuehaibing

On Wed, Nov 27, 2019 at 12:55:29AM +0700, Phong Tran wrote:
> 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>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/net/wireless/realtek/rtlwifi/pci.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
> index f88d26535978..25335bd2873b 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> @@ -1061,13 +1061,15 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
>  	return ret;
>  }
>  
> -static void _rtl_pci_irq_tasklet(struct ieee80211_hw *hw)
> +static void _rtl_pci_irq_tasklet(unsigned long data)
>  {
> +	struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
>  	_rtl_pci_tx_chk_waitq(hw);
>  }
>  
> -static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
> +static void _rtl_pci_prepare_bcn_tasklet(unsigned long data)
>  {
> +	struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
>  	struct rtl_priv *rtlpriv = rtl_priv(hw);
>  	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
>  	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
> @@ -1193,10 +1195,10 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw,
>  
>  	/*task */
>  	tasklet_init(&rtlpriv->works.irq_tasklet,
> -		     (void (*)(unsigned long))_rtl_pci_irq_tasklet,
> +		     _rtl_pci_irq_tasklet,
>  		     (unsigned long)hw);
>  	tasklet_init(&rtlpriv->works.irq_prepare_bcn_tasklet,
> -		     (void (*)(unsigned long))_rtl_pci_prepare_bcn_tasklet,
> +		     _rtl_pci_prepare_bcn_tasklet,
>  		     (unsigned long)hw);
>  	INIT_WORK(&rtlpriv->works.lps_change_work,
>  		  rtl_lps_change_work_callback);
> -- 
> 2.20.1
> 

-- 
Kees Cook

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

end of thread, back to index

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 15:02 [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type Phong Tran
2019-11-25 15:02 ` [PATCH 2/3] drivers: net: intel: " Phong Tran
2019-11-25 17:30   ` Larry Finger
2019-11-25 17:56     ` Kalle Valo
2019-11-25 15:02 ` [PATCH 3/3] drivers: net: realtek: " Phong Tran
2019-11-25 17:33   ` Larry Finger
2019-11-25 17:26 ` [PATCH 1/3] drivers: net: b43legacy: " Larry Finger
2019-11-25 17:28   ` Jakub Kicinski
2019-11-25 17:29   ` Kalle Valo
2019-11-26 17:55 ` [Patch v2 0/4] wireless: " Phong Tran
2019-11-26 17:55   ` [Patch v2 1/4] b43legacy: " Phong Tran
2019-11-27  5:05     ` Kees Cook
2019-11-26 17:55   ` [Patch v2 2/4] ipw2x00: " Phong Tran
2019-11-27  5:05     ` Kees Cook
2019-11-26 17:55   ` [Patch v2 3/4] iwlegacy: " Phong Tran
2019-11-27  5:05     ` Kees Cook
2019-11-26 17:55   ` [Patch v2 4/4] rtlwifi: rtl_pci: " Phong Tran
2019-11-27  5:05     ` Kees Cook

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/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-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org
	public-inbox-index linux-wireless

Example config snippet for mirrors

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


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