RE: two false alarms from checkpatch.pl

From: Jian Peng
Date: Mon Jun 13 2011 - 19:29:04 EST


Hi, Joe,

I can ignore both. On the other hand,

while (1);

is a style that was used universally by C programmers. Could you rethink about take this as exception in checkpatch.pl?

Thanks,
Jian

-----Original Message-----
From: Joe Perches [mailto:joe@xxxxxxxxxxx]
Sent: Monday, June 13, 2011 4:24 PM
To: Jian Peng
Cc: linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: two false alarms from checkpatch.pl

On Mon, 2011-06-13 at 16:18 -0700, Jian Peng wrote:
> After running "./scripts/checkpatch.pl -F arch/mips/kernel/syscall.c", I got some errors reported on valid lines
>
> ERROR: space prohibited before open square bracket '['
> #451: FILE: mips/kernel/syscall.c:451:
> + : [addr] "r" (addr),
>
> This line is valid, and if I remove the space in between, it will report a different error
>
> ERROR: spaces required around that ':' (ctx:ExV)
> #448: FILE: mips/kernel/syscall.c:448:
> + :[old] "=&r" (old),
> ^
> In another case, it reported

Known defect. checkpatch doesn't correctly parse asm.
checkpatch output isn't dicta.
You should just ignore it.

> ERROR: trailing statements should be on next line
> #515: FILE: mips/kernel/syscall.c:515:
> + while (1);
>
> This is also valid line.

That's really not a kernel style conformant line.

It really should be written as something like:

while (1) {
; /* Never exit */
}


N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i