Re: checkpatch falsepositives in Lustre code
From: Joe Perches
Date: Mon Feb 15 2016 - 19:56:37 EST
On Mon, 2016-02-15 at 18:49 -0500, Oleg Drokin wrote:
> Hello!
>
>
> As I am going over Lustre to clean up the code style, I noticed this bunch below.
>
> Those all are function definitions, though I guess it might have been foiled by
> return type on the previous line?
> Now sure if anything could be done about this.
>
> Thanks.
>
> ERROR: that open brace { should be on the previous line
> #2098: FILE: drivers/staging/lustre/lustre/libcfs/hash.c:1358:
> +cfs_ash_for_each_enter(struct cfs_hash *hs)
> +{
[etc...]
Yeah, that's a defect of some type.
I'm not sure if it's really possible to handle it well though.
Maybe there could be a test added for something like
"^[\+ ](?:$Declare\s*|DeclareMisordered\s*)?\$Ident\("
to find what looks like function declarations in the
first column to avoid some of these false positives.
Andy?