All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
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"
	<linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v3 4/4] rtw88: Fix Sparse warning for rtw8821c_hw_spec
Date: Wed, 08 Jun 2022 11:16:49 +0300	[thread overview]
Message-ID: <8735gfr2mm.fsf@kernel.org> (raw)
In-Reply-To: <5c48cda63e844e3f9703506309854a63@realtek.com> (Ping-Ke Shih's message of "Wed, 8 Jun 2022 08:05:46 +0000")

Ping-Ke Shih <pkshih@realtek.com> writes:

>> -----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;

Yeah, that definitely needs to be const.

> I will prepare another patch to fix that.

Great, thanks!

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

      reply	other threads:[~2022-06-08  8:56 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
2022-06-08  8:16               ` Kalle Valo [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=8735gfr2mm.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=pkshih@realtek.com \
    /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 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.