[lkml]   [2015]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectpossible new false positive in checkpatch
Since my last pull from upstream (today) , I started seeing some
checkpatch warnings regarding suspect code indent I believe are false
positive. Take this code for example:

static int foo(void)
while (bar())
/* do nothing */;

When running checkpath on it, the following warning is emitted:

tal@tal:~/Dev/lfs/linux|0 $ scripts/ -f ~/tmp/foo.c
WARNING: suspect code indent for conditional statements (8, 32)
#3: FILE: /home/tal/tmp/foo.c:3:
+ while (bar())
+ /* do nothing */;

total: 0 errors, 1 warnings, 5 lines checked

/home/tal/tmp/foo.c has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
tal@tal:~/Dev/lfs/linux|1 $

Using my limited perl knowledge, I believe the lines causing this are
# remove inline comments
$s =~ s/$;/ /g;
$c =~ s/$;/ /g;
Introduced in commit 9f5af480f4554aac12e002b6f5c2b04895857700:
checkpatch: improve SUSPECT_CODE_INDENT test
Commenting out these lines removes the warning.

This pattern exists in many places around the kernel source.
Is this the intended behavior?

 \ /
  Last update: 2015-09-12 14:41    [W:0.055 / U:1.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site