From patchwork Tue Feb 13 10:05:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 772825 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2924A224DE; Tue, 13 Feb 2024 10:05:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818755; cv=none; b=pTV60BnPkbUSTmUSkgW0adtG3/LvoFLiGODKSrL8DI1OQvL5ajF23Xo+6+Si2LzexN/JwZgw4WNE3yNrJKDVht/xooBHgJ4HNTwxeA2ZgeQN4LKPGRNQZDIDD0JfFdU46qx3oWr3PFcPD7MGlB9d6SzWpQi9ZJfxJrdW6RpaO+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818755; c=relaxed/simple; bh=WcxErgsyfFXrzhYEDf5rpkuxyuJrLmqXvy8MMKBGXI4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PrgnddatImdoC7SscqkedLcbI2ZvJVekZda0rTO98o6zaKWbpplmKqhxSo93lowF9wjgGKBZPwO/pfTSEsrpAnCuqTZWTb7Q2JWbGnN6hVJ0uaElM/6U6BMvJCRYDgKMqQ3JuFkrAudfMlRriUoeexXrwE3jWURhHX1xPVu2mXg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ksr6Pj7t; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ksr6Pj7t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2038C433C7; Tue, 13 Feb 2024 10:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707818755; bh=WcxErgsyfFXrzhYEDf5rpkuxyuJrLmqXvy8MMKBGXI4=; h=From:To:Cc:Subject:Date:From; b=ksr6Pj7tO+yUgZ8iAlv3c/Pj1vMUt6E3wElItA3YLBnLiVNvXsKdoBKa+RgkE+IOS o4vtDL5C6Jlx3laUNxU2lS2rERHlAFAWUTn9LkVJGRUulO46zGXA8CHfQv2EoK4M+4 Gr5JsMMN6xxcA1uPI8g3I4ZnaMYbyUrg1uYsGuVpTHzghcCl6a5zOXTCxVUfmkzp9a RLST521KRjwDe/6oimNzWc7ySZBwrg72nYL2Ira1q7HLpT4fcYznWRIgoTd30HiUxA BFw47WycdaE6G+iM0F6c7yeDCbaoeIKOuB1dEPjR7A0KgHcSIGuLZ9djvhbh1QDjkt rcAgl6U2d6PjA== From: Arnd Bergmann To: Arend van Spriel , Kalle Valo , Nathan Chancellor , Greg Kroah-Hartman , Pieter-Paul Giesberts Cc: Arnd Bergmann , Nick Desaulniers , Bill Wendling , Justin Stitt , Artem Chernyshev , Jonas Gorski , linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] brcmsmac: avoid function pointer casts Date: Tue, 13 Feb 2024 11:05:37 +0100 Message-Id: <20240213100548.457854-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Arnd Bergmann 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: d89a4c80601d ("staging: brcm80211: removed void * from softmac phy") Signed-off-by: Arnd Bergmann Acked-by: Arend van Spriel --- .../net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c | 3 ++- drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c | 5 ++--- drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c index 07f83ff5a54a..a27d6f0b8819 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c @@ -383,8 +383,9 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp) 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; if (PHY_PERICAL_MPHASE_PENDING(pi)) { diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c index a0de5db0cd64..b72381791536 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c @@ -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, - void (*fn)(struct brcms_phy *pi), + void (*fn)(void *pi), void *arg, const char *name) { return (struct wlapi_timer *) - brcms_init_timer(physhim->wl, (void (*)(void *))fn, - arg, name); + brcms_init_timer(physhim->wl, fn, arg, name); } void wlapi_free_timer(struct wlapi_timer *t) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h index dd8774717ade..27d0934e600e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h @@ -131,7 +131,7 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim); /* PHY to WL utility functions */ 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 wlapi_free_timer(struct wlapi_timer *t); void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);