[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1408728421.13483.43.camel@joe-AO725>
Date: Fri, 22 Aug 2014 10:27:01 -0700
From: Joe Perches <joe@...ches.com>
To: Andy Lutomirski <luto@...capital.net>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>,
Andy Whitcroft <apw@...onical.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] checkpatch.pl: New instances of ENOSYS are errors
On Fri, 2014-08-22 at 09:26 -0700, Andy Lutomirski wrote:
> ENOSYS means that a nonexistent system call was called. We have a
> bad habit of using it for things like invalid operations on
> otherwise valid syscalls. We should avoid this in new code.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -2931,6 +2931,14 @@ sub process {
> "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr);
> }
>
> +# ENOSYS means "bad syscall nr" and nothing else
> +# (note that this doesn't run on assembly files, so entry*.S is okay)
> + if ($line =~ /\bENOSYS\b/) {
> + ERROR("ENOSYS",
> + "ENOSYS means 'invalid syscall nr' and nothing else\n" .
> + " (ignore if this really is syscall entry code)\n" . $herecurr);
> + }
> +
> # function brace can't be on same line, except for #defines of do while,
> # or if closed on same line
> if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
Hi again Andy.
I think this is OK, but you seem to be making
this patch against an old version of checkpatch.
It applies with an offset of a few hundred lines
to Linus' tree and to -next.
Some trivial comments:
I think the "(note that" comment line isn't very useful.
All the tests after:
next if ($realfile !~ /\.(h|c)$/);
have that attribute.
checkpatch doesn't use multi-line message descriptions.
The "(ignore if this" line should not be on a separate line
but simply use a longer single output line.
ERROR types should not have false positives.
I'd prefer WARN.
cheers, Joe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists