* two false alarms from checkpatch.pl
@ 2011-06-13 23:18 Jian Peng
2011-06-13 23:23 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Jian Peng @ 2011-06-13 23:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Jian Peng
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
ERROR: trailing statements should be on next line
#515: FILE: mips/kernel/syscall.c:515:
+ while (1);
This is also valid line.
The above two cases are both false alarms, and need to be treated as exceptions in "checkpatch.pl -F".
Thanks,
Jian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: two false alarms from checkpatch.pl
2011-06-13 23:18 two false alarms from checkpatch.pl Jian Peng
@ 2011-06-13 23:23 ` Joe Perches
2011-06-13 23:28 ` Jian Peng
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2011-06-13 23:23 UTC (permalink / raw)
To: Jian Peng; +Cc: linux-kernel
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 */
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: two false alarms from checkpatch.pl
2011-06-13 23:23 ` Joe Perches
@ 2011-06-13 23:28 ` Jian Peng
2011-06-13 23:36 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Jian Peng @ 2011-06-13 23:28 UTC (permalink / raw)
To: Joe Perches; +Cc: linux-kernel, Jian Peng
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1503 bytes --]
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@perches.com]
Sent: Monday, June 13, 2011 4:24 PM
To: Jian Peng
Cc: linux-kernel@vger.kernel.org
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Ç+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: two false alarms from checkpatch.pl
2011-06-13 23:28 ` Jian Peng
@ 2011-06-13 23:36 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2011-06-13 23:36 UTC (permalink / raw)
To: Jian Peng; +Cc: linux-kernel
On Mon, 2011-06-13 at 16:28 -0700, Jian Peng wrote:
> 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?
For some subset of C programmers... ;)
The kernel generally uses "unreachable()" instead.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-06-13 23:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-13 23:18 two false alarms from checkpatch.pl Jian Peng
2011-06-13 23:23 ` Joe Perches
2011-06-13 23:28 ` Jian Peng
2011-06-13 23:36 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®