From 6cfed598480493d814414ce7e53027bd6fc45c49 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Fri, 15 Nov 2019 09:28:28 -0800 Subject: staging: rtl*: Remove tasklet callback casts In order to make the entire kernel usable under Clang's Control Flow Integrity protections, function prototype casts need to be avoided because this will trip CFI checks at runtime (i.e. a mismatch between the caller's expected function prototype and the destination function's prototype). Many of these cases can be found with -Wcast-function-type, which found that the rtl wifi drivers had a bunch of needless function casts. Remove function casts for tasklet callbacks in the various drivers. Signed-off-by: Kees Cook Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/201911150926.2894A4F973@keescook Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_softmac.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/staging/rtl8192e') diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index f2f7529e7c80..6e2f620afd14 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -2044,8 +2044,9 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) } -static inline void rtllib_sta_ps(struct rtllib_device *ieee) +static inline void rtllib_sta_ps(unsigned long data) { + struct rtllib_device *ieee = (struct rtllib_device *)data; u64 time; short sleep; unsigned long flags, flags2; @@ -3027,9 +3028,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee) spin_lock_init(&ieee->mgmt_tx_lock); spin_lock_init(&ieee->beacon_lock); - tasklet_init(&ieee->ps_task, - (void(*)(unsigned long)) rtllib_sta_ps, - (unsigned long)ieee); + tasklet_init(&ieee->ps_task, rtllib_sta_ps, (unsigned long)ieee); } -- cgit v1.2.3-59-g8ed1b