Re: [PATCH v4 01/12] wifi: ath12k: add multiple radio support in a single MAC HW un/register

Kalle Valo
2024-03-13T16:58:48Z

Kalle Valo <kvalo@kernel.org> writes:

> Jeff Johnson <quic_jjohnson@quicinc.com> writes:
>
>> On 3/13/2024 5:57 AM, Rameshkumar Sundaram wrote:
>>> On 3/13/2024 3:23 AM, Jeff Johnson wrote:
>>>> and guess we have to figure out how to suppress the ath12k-check issues with
>>>> this macro
>>> ath12k-check complains about the reuse of ah and index arguments which
>>> may get evaluated multiple times if its an arithmetic expression, But
>>> areas where we use the macro in our code aren't doing so.
>>> Do you have any suggestions here ? or shall we go back and use this
>>> for-loop inline.
>>
>> The macro makes sense -- we'll need to update the overrides in ath12k-check.
>
> IIRC it is possible to avoid variable reuse in macros with typeof()
> operator (or something like that). I can't remember the details right
> now but I think there are examples in the kernel code.

Here's the GCC documentation with an example:

https://gcc.gnu.org/onlinedocs/gcc/Typeof.html

--