* checkpatch false positive for "do not use assignment in if condition"
@ 2026-05-09 21:53 Ethan Nelson-Moore
2026-05-10 0:20 ` Ethan Nelson-Moore
0 siblings, 1 reply; 3+ messages in thread
From: Ethan Nelson-Moore @ 2026-05-09 21:53 UTC (permalink / raw)
To: linux-kernel; +Cc: Andy Whitcroft, Joe Perches, Lukas Bulwahn, Dwaipayan Ray
Hello,
I got a strange error from checkpatch while preparing this patch for submission:
https://lore.kernel.org/all/20260509214622.38319-1-enelsonmoore@gmail.com/
ERROR: do not use assignment in if condition
#37: FILE: sound/soc/fsl/eukrea-tlv320.c:145:
+ if (of_machine_is_compatible("eukrea,cpuimx27") ||
ERROR: do not use assignment in if condition
#48: FILE: sound/soc/fsl/eukrea-tlv320.c:162:
+ } else if (of_machine_is_compatible("eukrea,cpuimx25") ||
These lines do not even contain =.
Could someone look into why this happened?
Have a nice day!
Ethan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: checkpatch false positive for "do not use assignment in if condition"
2026-05-09 21:53 checkpatch false positive for "do not use assignment in if condition" Ethan Nelson-Moore
@ 2026-05-10 0:20 ` Ethan Nelson-Moore
2026-05-10 19:31 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Ethan Nelson-Moore @ 2026-05-10 0:20 UTC (permalink / raw)
To: linux-kernel; +Cc: Andy Whitcroft, Joe Perches, Lukas Bulwahn, Dwaipayan Ray
On Sat, May 9, 2026 at 2:53 PM Ethan Nelson-Moore
<enelsonmoore@gmail.com> wrote:
> These lines do not even contain =.
> Could someone look into why this happened?
The lines *after* the affected patch hunks do have an assignment in
the if condition.
Ethan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: checkpatch false positive for "do not use assignment in if condition"
2026-05-10 0:20 ` Ethan Nelson-Moore
@ 2026-05-10 19:31 ` Joe Perches
0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2026-05-10 19:31 UTC (permalink / raw)
To: Ethan Nelson-Moore
Cc: linux-kernel, Andy Whitcroft, Lukas Bulwahn, Dwaipayan Ray
On 2026-05-09 17:20, Ethan Nelson-Moore wrote:
> On Sat, May 9, 2026 at 2:53 PM Ethan Nelson-Moore
> <enelsonmoore@gmail.com> wrote:
>> These lines do not even contain =.
>> Could someone look into why this happened?
>
> The lines *after* the affected patch hunks do have an assignment in
> the if condition.
checkpatch is fundamentally stupid and an incomplete parser. Rely on
your brain to ignore its incorrect bleats when it's wrong.
FYI it's looking for a single equal sign in the statement
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-10 19:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-09 21:53 checkpatch false positive for "do not use assignment in if condition" Ethan Nelson-Moore
2026-05-10 0:20 ` Ethan Nelson-Moore
2026-05-10 19:31 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox