Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtlwifi: rtl_pci: Fix -Wcast-function-type

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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Phong Tran and committed by
Kalle Valo
cb775c88 da5e57e8

+6 -4
+6 -4
drivers/net/wireless/realtek/rtlwifi/pci.c
··· 1061 1061 return ret; 1062 1062 } 1063 1063 1064 - static void _rtl_pci_irq_tasklet(struct ieee80211_hw *hw) 1064 + static void _rtl_pci_irq_tasklet(unsigned long data) 1065 1065 { 1066 + struct ieee80211_hw *hw = (struct ieee80211_hw *)data; 1066 1067 _rtl_pci_tx_chk_waitq(hw); 1067 1068 } 1068 1069 1069 - static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) 1070 + static void _rtl_pci_prepare_bcn_tasklet(unsigned long data) 1070 1071 { 1072 + struct ieee80211_hw *hw = (struct ieee80211_hw *)data; 1071 1073 struct rtl_priv *rtlpriv = rtl_priv(hw); 1072 1074 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1073 1075 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); ··· 1195 1193 1196 1194 /*task */ 1197 1195 tasklet_init(&rtlpriv->works.irq_tasklet, 1198 - (void (*)(unsigned long))_rtl_pci_irq_tasklet, 1196 + _rtl_pci_irq_tasklet, 1199 1197 (unsigned long)hw); 1200 1198 tasklet_init(&rtlpriv->works.irq_prepare_bcn_tasklet, 1201 - (void (*)(unsigned long))_rtl_pci_prepare_bcn_tasklet, 1199 + _rtl_pci_prepare_bcn_tasklet, 1202 1200 (unsigned long)hw); 1203 1201 INIT_WORK(&rtlpriv->works.lps_change_work, 1204 1202 rtl_lps_change_work_callback);