All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: brcmsmac: Remove const from tbl_ptr parameter in wlc_lcnphy_common_read_table()
@ 2025-07-16  2:45 Nathan Chancellor
  2025-07-16  9:32 ` Arend van Spriel
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2025-07-16  2:45 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl, llvm, patches,
	stable, Nathan Chancellor

A new warning in clang [1] complains that diq_start in
wlc_lcnphy_tx_iqlo_cal() is passed uninitialized as a const pointer to
wlc_lcnphy_common_read_table():

  drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:2728:13: error: variable 'diq_start' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
   2728 |                                                      &diq_start, 1, 16, 69);
        |                                                       ^~~~~~~~~

The table pointer passed to wlc_lcnphy_common_read_table() should not be
considered constant, as wlc_phy_read_table() is ultimately going to
update it. Remove the const qualifier from the tbl_ptr to clear up the
warning.

Cc: stable@vger.kernel.org
Closes: https://github.com/ClangBuiltLinux/linux/issues/2108
Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers")
Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
index d0faba240561..b4bba67a45ec 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -919,7 +919,7 @@ void wlc_lcnphy_read_table(struct brcms_phy *pi, struct phytbl_info *pti)
 
 static void
 wlc_lcnphy_common_read_table(struct brcms_phy *pi, u32 tbl_id,
-			     const u16 *tbl_ptr, u32 tbl_len,
+			     u16 *tbl_ptr, u32 tbl_len,
 			     u32 tbl_width, u32 tbl_offset)
 {
 	struct phytbl_info tab;

---
base-commit: bbc19fef578970158847a41d9b6b6b218034b8c2
change-id: 20250715-brcmsmac-fix-uninit-const-pointer-d35114a50936

Best regards,
--  
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wifi: brcmsmac: Remove const from tbl_ptr parameter in wlc_lcnphy_common_read_table()
  2025-07-16  2:45 [PATCH] wifi: brcmsmac: Remove const from tbl_ptr parameter in wlc_lcnphy_common_read_table() Nathan Chancellor
@ 2025-07-16  9:32 ` Arend van Spriel
  0 siblings, 0 replies; 2+ messages in thread
From: Arend van Spriel @ 2025-07-16  9:32 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl, llvm, patches,
	stable

On 7/16/2025 4:45 AM, Nathan Chancellor wrote:
> A new warning in clang [1] complains that diq_start in
> wlc_lcnphy_tx_iqlo_cal() is passed uninitialized as a const pointer to
> wlc_lcnphy_common_read_table():
> 
>    drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:2728:13: error: variable 'diq_start' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
>     2728 |                                                      &diq_start, 1, 16, 69);
>          |                                                       ^~~~~~~~~
> 
> The table pointer passed to wlc_lcnphy_common_read_table() should not be
> considered constant, as wlc_phy_read_table() is ultimately going to
> update it. Remove the const qualifier from the tbl_ptr to clear up the
> warning.
> 
> Cc: stable@vger.kernel.org
> Closes: https://github.com/ClangBuiltLinux/linux/issues/2108
> Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers")
> Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1]

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>> 
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-16  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16  2:45 [PATCH] wifi: brcmsmac: Remove const from tbl_ptr parameter in wlc_lcnphy_common_read_table() Nathan Chancellor
2025-07-16  9:32 ` Arend van Spriel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.