From: Joe Perches <joe@perches.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
Andy Whitcroft <apw@canonical.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] checkpatch.pl: New instances of ENOSYS are errors
Date: Fri, 22 Aug 2014 10:27:01 -0700 [thread overview]
Message-ID: <1408728421.13483.43.camel@joe-AO725> (raw)
In-Reply-To: <72714b6b69d00496d6e55453423c4070de292bf4.1408724662.git.luto@amacapital.net>
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
next prev parent reply other threads:[~2014-08-22 17:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 16:26 Andy Lutomirski
2014-08-22 17:27 ` Joe Perches [this message]
2014-08-25 10:29 ` Pavel Machek
2014-08-25 18:38 ` Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408728421.13483.43.camel@joe-AO725 \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mtk.manpages@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®