* -Wconstant-conversion in drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
@ 2026-09-16 6:44 Nathan Chancellor
[not found] ` <1a107d87260.2873.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com>
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2026-09-16 6:44 UTC (permalink / raw)
To: Arend van Spriel; +Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl
Hi Arend,
After [1] landed in clang main, I am seeing the following warning
(turned error with CONFIG_WERROR=y / W=e):
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c:224:18: error: implicit conversion from 'int' to 's8' (aka 'signed char') changes value from 128 to -128 [-Werror,-Wconstant-conversion]
224 | {0, 0, 0, 0, 0, 128},
| ~ ^~~
As far as I can tell, this has been present since the original commit
that added brcm80211 to the tree
a9533e7ea3c4 ("Staging: Add initial release of brcm80211 - Broadcom 802.11n wireless LAN driver.")
based on my reading of drivers/staging/brcm80211/phy/wlc_phy_n.c. Should
this final value be changed to -128 or should there be some other fix?
[1]: https://github.com/llvm/llvm-project/commit/a5ef934a8d295dc03be3960f2b3744ec2e53238e
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 3+ messages in thread[parent not found: <1a107d87260.2873.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com>]
* Re: -Wconstant-conversion in drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c [not found] ` <1a107d87260.2873.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> @ 2026-10-04 17:07 ` Arend van Spriel 2026-10-05 10:54 ` Nathan Chancellor 0 siblings, 1 reply; 3+ messages in thread From: Arend van Spriel @ 2026-10-04 17:07 UTC (permalink / raw) To: Nathan Chancellor; +Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl resending... Op 16 september 2026 08:45:59 schreef Nathan Chancellor <nathan@kernel.org>: > Hi Arend, > > After [1] landed in clang main, I am seeing the following warning > (turned error with CONFIG_WERROR=y / W=e): > > drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c:224:18: error: > implicit conversion from 'int' to 's8' (aka 'signed char') changes value > from 128 to -128 [-Werror,-Wconstant-conversion] > 224 | {0, 0, 0, 0, 0, 128}, > | ~ ^~~ > > As far as I can tell, this has been present since the original commit > that added brcm80211 to the tree > > a9533e7ea3c4 ("Staging: Add initial release of brcm80211 - Broadcom 802.11n > wireless LAN driver.") > > based on my reading of drivers/staging/brcm80211/phy/wlc_phy_n.c. Should > this final value be changed to -128 or should there be some other fix? To be honest I don't know. If I looked at the proprietary driver code that table entry is still there with exactly the same values. So to be type correct while preserving the same value it should be -128. However, looking at the table entry struct it is an index so that sounds odd. Regards, Arend ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: -Wconstant-conversion in drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c 2026-10-04 17:07 ` Arend van Spriel @ 2026-10-05 10:54 ` Nathan Chancellor 0 siblings, 0 replies; 3+ messages in thread From: Nathan Chancellor @ 2026-10-05 10:54 UTC (permalink / raw) To: Arend van Spriel; +Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl On Sun, Oct 04, 2026 at 07:07:01PM +0200, Arend van Spriel wrote: > Op 16 september 2026 08:45:59 schreef Nathan Chancellor <nathan@kernel.org>: > > > Hi Arend, > > > > After [1] landed in clang main, I am seeing the following warning > > (turned error with CONFIG_WERROR=y / W=e): > > > > drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c:224:18: > > error: implicit conversion from 'int' to 's8' (aka 'signed char') > > changes value from 128 to -128 [-Werror,-Wconstant-conversion] > > 224 | {0, 0, 0, 0, 0, 128}, > > | ~ ^~~ > > > > As far as I can tell, this has been present since the original commit > > that added brcm80211 to the tree > > > > a9533e7ea3c4 ("Staging: Add initial release of brcm80211 - Broadcom > > 802.11n wireless LAN driver.") > > > > based on my reading of drivers/staging/brcm80211/phy/wlc_phy_n.c. Should > > this final value be changed to -128 or should there be some other fix? > > To be honest I don't know. If I looked at the proprietary driver code that > table entry is still there with exactly the same values. So to be type > correct while preserving the same value it should be -128. However, looking > at the table entry struct it is an index so that sounds odd. Thanks a lot for the input! I sent a patch to change it to -128 to clear up the warning since it will be the same bit representation and presumably things are working properly with that: https://lore.kernel.org/20260916064454.GA3635613@ax162/ -- Cheers, Nathan ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-05 10:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 6:44 -Wconstant-conversion in drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c Nathan Chancellor
[not found] ` <1a107d87260.2873.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com>
2026-10-04 17:07 ` Arend van Spriel
2026-10-05 10:54 ` Nathan Chancellor
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox