Spurious warning in checkpatch.pl?
Subsystems (3)
Andy,
The checkpatch.pl version in mainline is issuing what I think are false warnings of the type
WARNING: networking block comments put the trailing */ on a separate line #93: FILE: drivers/net/wireless/rtlwifi/wifi.h:208:
+ u32 rf_rb; /* rflssi_readback */
Is a trailing comment for the member of a struct not allowed?
Thanks,
Larry
Joe Perches
maintainerQuoted 10 lines · Larry Finger
Andy,
The checkpatch.pl version in mainline is issuing what I think are false warnings of the type
WARNING: networking block comments put the trailing */ on a separate line #93: FILE:
drivers/net/wireless/rtlwifi/wifi.h:208:
+ u32rf_rb; /*rflssi_readback*/Is a trailing comment for the member of a struct not allowed?
It's allowed. Maybe even better, encouraged.
It's a change I made in commit 058806007450 ("checkpatch: check networking specific block comment style") without sufficient testing.
I'll see about fixing it.
Quoted 12 lines · Joe Perches
Quoted 10 lines · Larry Finger
Andy,
The checkpatch.pl version in mainline is issuing what I think are false warnings of the type
WARNING: networking block comments put the trailing */ on a separate line #93: FILE:
drivers/net/wireless/rtlwifi/wifi.h:208:
+ u32rf_rb; /*rflssi_readback*/Is a trailing comment for the member of a struct not allowed?
Quoted 7 lines
It's allowed. Maybe even better, encouraged.
It's a change I made in commit 058806007450 ("checkpatch: check networking specific block comment style") without sufficient testing.
I'll see about fixing it.
Joe,
Good. I will ignore those warnings.
One more question. Was the warning below intended?
WARNING: networking block comments put the trailing */ on a separate line #1846: FILE: drivers/net/wireless/rtlwifi/rtl8723ae/hal_btc.h:27:
+ *****************************************************************************/
To me, that line at the end of a copyright block looks better then
****************************************************************************
*/
Larry
Joe Perches
maintainerQuoted 11 lines · Larry Finger
One more question. Was the warning below intended?
WARNING: networking block comments put the trailing */ on a separate line #1846: FILE:
drivers/net/wireless/rtlwifi/rtl8723ae/hal_btc.h:27:
+ *****************************************************************************/To me, that line at the end of a copyright block looks better then
****************************************************************************
*/
No, not really. It's a side effect of the nominal block comment style that networking uses.
Maybe it could be improved by ignoring lines that end in "**/" (\*\*\/\s*$) too.
Joe Perches
maintainerPATCH 1/1 checkpatch: Improve network block comment style checking
In reply to Larry FingerSome comment styles in net and drivers/net are flagged inappropriately.
Avoid proclaiming inline comments like:
int a = b; /* some comment */
and block comments like:
/********************* * some comment ********************/
are defective.
Tested with
$ cat drivers/net/t.c /* foo */
/*
* foo
*/
/* foo
*/
/* foo
* bar */
/****************************
* some long block comment
***************************/
struct foo {
int bar; /* another test */
};
$
--- scripts/checkpatch.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +4 -2
@@ -1890,8 +1890,10 @@ sub process { } if ($realfile =~ m@^(drivers/net/|net/)@ && - $rawline !~ m@^\+[ \t]*(\/\*|\*\/)@ && - $rawline =~ m@^\+[ \t]*.+\*\/[ \t]*$@) { + $rawline !~ m@^\+[ \t]*\*/[ \t]*$@ && #trailing */ + $rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ && #inline /*...*/ + $rawline !~ m@^\+.*\*{2,}/[ \t]*$@ && #trailing **/ + $rawline =~ m@^\+[ \t]*.+\*\/[ \t]*$@) { #non blank */ WARN("NETWORKING_BLOCK_COMMENT_STYLE", "networking block comments put the trailing */ on a separate line\n" . $herecurr); }