From 1c22482e9d62b52a57e48b7811c5e950c4697932 Mon Sep 17 00:00:00 2001 From: Bitterblue Smith Date: Tue, 10 Dec 2024 13:59:26 +0200 Subject: [PATCH] Fix compilation for Openwrt CC [M] /media/Standard/openwrt/openwrt-sdk-24.10.0-rc2-mediatek-filogic_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/rtw88-usb-2024.11.27~611874c6/usb.o /media/Standard/openwrt/openwrt-sdk-24.10.0-rc2-mediatek-filogic_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/rtw88-usb-2024.11.27~611874c6/usb.c: In function 'rtw_usb_init_rx': /media/Standard/openwrt/openwrt-sdk-24.10.0-rc2-mediatek-filogic_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/rtw88-usb-2024.11.27~611874c6/usb.c:943:22: error: cast between incompatible function types from 'void (*)(struct rtw_usb *)' to 'void (*)(long unsigned int)' [-Werror=cast-function-type] 943 | (void(*)(unsigned long))rtw_usb_rx_handler, | ^ cc1: all warnings being treated as errors Fixes https://github.com/lwfinger/rtw88/issues/253. Signed-off-by: Bitterblue Smith --- usb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usb.c b/usb.c index 9dafc75..64c8a75 100644 --- a/usb.c +++ b/usb.c @@ -554,8 +554,9 @@ static void rtw_usb_rx_handler(struct work_struct *work) { struct rtw_usb *rtwusb = container_of(work, struct rtw_usb, rx_work); #else -static void rtw_usb_rx_handler(struct rtw_usb *rtwusb) +static void rtw_usb_rx_handler(unsigned long shut_up_gcc) { + struct rtw_usb *rtwusb = (struct rtw_usb *)shut_up_gcc; #endif struct rtw_dev *rtwdev = rtwusb->rtwdev; const struct rtw_chip_info *chip = rtwdev->chip; @@ -939,8 +940,7 @@ static int rtw_usb_init_rx(struct rtw_dev *rtwdev) #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0) rtwusb->rxwq = alloc_workqueue("rtw88_usb: rx wq", WQ_BH, 0); #else - tasklet_init(&rtwusb->rx_tasklet, - (void(*)(unsigned long))rtw_usb_rx_handler, + tasklet_init(&rtwusb->rx_tasklet, rtw_usb_rx_handler, (unsigned long)rtwusb); rtwusb->rxwq = create_singlethread_workqueue("rtw88_usb: rx wq");