2019-11-26 17:58:48

by Phong Tran

[permalink] [raw]
Subject: [Patch v2 0/4] wireless: Fix -Wcast-function-type

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/[email protected]/

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


2019-11-26 17:58:50

by Phong Tran

[permalink] [raw]
Subject: [Patch v2 1/4] b43legacy: Fix -Wcast-function-type

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

Tested-by: Larry Finger <[email protected]>
Signed-off-by: Phong Tran <[email protected]>
---
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

2019-11-27 05:07:08

by Kees Cook

[permalink] [raw]
Subject: Re: [Patch v2 1/4] b43legacy: Fix -Wcast-function-type

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 <[email protected]>
> Signed-off-by: Phong Tran <[email protected]>

Thanks for sending these!

Reviewed-by: Kees Cook <[email protected]>

-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