From: Ping-Ke Shih <pkshih@realtek.com>
To: "Ondřej Jirman" <megi@xff.cz>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"open list:REALTEK WIRELESS DRIVER (rtw89)"
<linux-wireless@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtw89: Fix inadverent sharing of struct ieee80211_supported_band data
Date: Tue, 29 Apr 2025 00:21:22 +0000 [thread overview]
Message-ID: <85baab98b0e74936bdecac3a63552f1a@realtek.com> (raw)
In-Reply-To: <yurmw275hyo3zwstdwfqyepan3mj3anqavnpv6hu2742h4ofgx@c56eohg3s6ue>
> > Since you have duplicated arrays of channels and bitrate, we should add const
> > to them, like:
> >
> > static const struct ieee80211_channel rtw89_channels_{2ghz,5ghz,6ghz}[]
> > static const struct ieee80211_rate rtw89_bitrates[]
>
> That will produce:
>
> initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>
> warnings, because struct ieee80211_supported_band doesn't have these fields
> as const. The discarding of const qualifiers is apparently safe in this case,
> so I can either cast the pointers to non-const when assigned here:
>
> 270 static const struct ieee80211_supported_band rtw89_sband_2ghz = {
> 271 .band = NL80211_BAND_2GHZ,
> 272 .channels = rtw89_channels_2ghz,
> 273 .n_channels = ARRAY_SIZE(rtw89_channels_2ghz),
> 274 .bitrates = rtw89_bitrates,
> 275 .n_bitrates = ARRAY_SIZE(rtw89_bitrates),
> 276 .ht_cap = {0},
> 277 .vht_cap = {0},
> 278 };
>
Ah. I was not aware of this point. Please keep it as was.
prev parent reply other threads:[~2025-04-29 0:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-27 0:24 [PATCH] wifi: rtw89: Fix inadverent sharing of struct ieee80211_supported_band data Ondřej Jirman
2025-04-28 1:53 ` Ping-Ke Shih
2025-04-28 21:50 ` Ondřej Jirman
2025-04-29 0:21 ` Ping-Ke Shih [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=85baab98b0e74936bdecac3a63552f1a@realtek.com \
--to=pkshih@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=megi@xff.cz \
/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