Re: [PATCHv2 ath-next] wifi: ath9k: mark static arrays as const

From: Toke Høiland-Jørgensen

Date: Tue Jun 23 2026 - 09:03:45 EST


Rosen Penev <rosenp@xxxxxxxxx> writes:

> On Mon, Jun 22, 2026 at 4:49 AM Toke Høiland-Jørgensen <toke@xxxxxxx> wrote:
>>
>> Rosen Penev <rosenp@xxxxxxxxx> writes:
>>
>> > PN9Data is a read-only lookup table and is never modified. Adding const
>> > lets the compiler place it in .rodata and prevents accidental writes.
>> >
>> > Use the same treatment for bits_per_symbol. It's not modified either.
>> >
>> > Assisted-by: opencode:big-pickle
>> > Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
>>
>> Again, which actual bug are you fixing here?
> Patches are required to be bugfixes?

Well, or at least have some concrete benefit? You're changing working
code here, we've had to revert patches of this kind before because it
broke things.

For this patch specifically, there's one of two cases:

- The array is never written to, in which case the patch has no
practical effect

or

- The array *is* actually written to somewhere, in which case the kernel
will now crash as soon as someone tries to run the code.

Either way, I don't see how the risk/benefit tradeoff comes off positive
for this patch?

-Toke