Commit e1ea6db3 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Kalle Valo

wifi: brcmsmac: avoid function pointer casts

An old cleanup went a little too far and causes a warning with clang-16
and higher as it breaks control flow integrity (KCFI) rules:

drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c:64:34: error: cast from 'void (*)(struct brcms_phy *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
   64 |                         brcms_init_timer(physhim->wl, (void (*)(void *))fn,
      |                                                       ^~~~~~~~~~~~~~~~~~~~

Change this one instance back to passing a void pointer so it can be
used with the timer callback interface.

Fixes: d89a4c80 ("staging: brcm80211: removed void * from softmac phy")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240213100548.457854-1-arnd@kernel.org
parent 42ffccd0
...@@ -383,8 +383,9 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp) ...@@ -383,8 +383,9 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp)
return sh; return sh;
} }
static void wlc_phy_timercb_phycal(struct brcms_phy *pi) static void wlc_phy_timercb_phycal(void *ptr)
{ {
struct brcms_phy *pi = ptr;
uint delay = 5; uint delay = 5;
if (PHY_PERICAL_MPHASE_PENDING(pi)) { if (PHY_PERICAL_MPHASE_PENDING(pi)) {
......
...@@ -57,12 +57,11 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim) ...@@ -57,12 +57,11 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim)
} }
struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim, struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
void (*fn)(struct brcms_phy *pi), void (*fn)(void *pi),
void *arg, const char *name) void *arg, const char *name)
{ {
return (struct wlapi_timer *) return (struct wlapi_timer *)
brcms_init_timer(physhim->wl, (void (*)(void *))fn, brcms_init_timer(physhim->wl, fn, arg, name);
arg, name);
} }
void wlapi_free_timer(struct wlapi_timer *t) void wlapi_free_timer(struct wlapi_timer *t)
......
...@@ -131,7 +131,7 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim); ...@@ -131,7 +131,7 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim);
/* PHY to WL utility functions */ /* PHY to WL utility functions */
struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim, struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
void (*fn)(struct brcms_phy *pi), void (*fn)(void *pi),
void *arg, const char *name); void *arg, const char *name);
void wlapi_free_timer(struct wlapi_timer *t); void wlapi_free_timer(struct wlapi_timer *t);
void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic); void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment