From: Nathan Chancellor <nathan@kernel.org>
To: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev,
brcm80211-dev-list.pdl@broadcom.com
Subject: Re: -Wconstant-conversion in drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
Date: Mon, 5 Oct 2026 12:54:14 +0200 [thread overview]
Message-ID: <20261005105414.GA1018014@ax162> (raw)
In-Reply-To: <1a107e21b08.2873.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com>
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
prev parent reply other threads:[~2026-10-05 10:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261005105414.GA1018014@ax162 \
--to=nathan@kernel.org \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=brcm80211@lists.linux.dev \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox