From: Ping-Ke Shih <pkshih@realtek.com>
To: Kalle Valo <kvalo@kernel.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Nathan Chancellor <nathan@kernel.org>,
Johannes Berg <johannes@sipsolutions.net>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH v3 4/4] rtw88: Fix Sparse warning for rtw8821c_hw_spec
Date: Wed, 8 Jun 2022 08:05:46 +0000 [thread overview]
Message-ID: <5c48cda63e844e3f9703506309854a63@realtek.com> (raw)
In-Reply-To: <87bkv3r43b.fsf@kernel.org>
> -----Original Message-----
> From: Kalle Valo <kvalo@kernel.org>
> Sent: Wednesday, June 8, 2022 3:45 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Larry Finger <Larry.Finger@lwfinger.net>; Nathan Chancellor <nathan@kernel.org>; Johannes Berg
> <johannes@sipsolutions.net>; linux-wireless@vger.kernel.org
> Subject: Re: [PATCH v3 4/4] rtw88: Fix Sparse warning for rtw8821c_hw_spec
>
> Ping-Ke Shih <pkshih@realtek.com> writes:
>
> >
> > The ch_param[3] is only used by 8821c, so it doesn't affect other devices.
> > I will prepare a patch to fix it.
>
> But why didn't the compiler catch this? Is there some evil cast
> somewhere which removes the const? We should fix that as well (in a
> separate patch).
>
This is because we assign a const to .driver_data that is non-const kernel_ulong_t:
static const struct pci_device_id rtw_8821ce_id_table[] = {
{
.driver_data = (kernel_ulong_t)&rtw8821c_hw_spec
},
When casting it back in pci_probe(), we need to add 'const' after Larry's patches:
rtwdev->chip = (struct rtw_chip_info *)id->driver_data;
I will prepare another patch to fix that.
Ping-Ke
next prev parent reply other threads:[~2022-06-08 8:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 15:37 [PATCH v3 4/4] rtw88: Fix Sparse warning for rtw8821c_hw_spec Larry Finger
2022-06-07 19:05 ` Nathan Chancellor
2022-06-07 21:25 ` Larry Finger
2022-06-08 0:25 ` Ping-Ke Shih
2022-06-08 1:03 ` Larry Finger
2022-06-08 1:10 ` Ping-Ke Shih
2022-06-08 7:45 ` Kalle Valo
2022-06-08 8:05 ` Ping-Ke Shih [this message]
2022-06-08 8:16 ` Kalle Valo
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=5c48cda63e844e3f9703506309854a63@realtek.com \
--to=pkshih@realtek.com \
--cc=Larry.Finger@lwfinger.net \
--cc=johannes@sipsolutions.net \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nathan@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;
as well as URLs for NNTP newsgroup(s).