linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andy Lutomirski <luto@amacapital.net>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	Andy Whitcroft <apw@canonical.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] checkpatch.pl: New instances of ENOSYS are errors
Date: Fri, 22 Aug 2014 11:14:30 -0700	[thread overview]
Message-ID: <1408731270.17241.12.camel@joe-AO725> (raw)
In-Reply-To: <5eb299021dec23c1a48fa7d9f2c8b794e967766d.1408730669.git.luto@amacapital.net>

On Fri, 2014-08-22 at 11:05 -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.

Seems sensible thanks for persisting.

Andrew Morton is generally the upstream path (cc'd)

> Signed-off-by: Andy Lutomirski <luto@amacapital.net>
> ---
> 
> Pervasive incorrect usage of ENOSYS came up at the kernel summit ABI
> review discussion.  Let's see if checkpatch can help.
> 
> I'll submit a separate patch for include/uapi/asm-generic/errno.h.
> 
> Changes from v2:
>  - Reduce severity to WARN.
>  - Remove unnecessary clarification.
>  - Rebase onto Linus' tree instead of v3.16.
> 
> Changes from v1:
>  - Moved later so that it won't warn on context lines.
>  - Use $herecur.
>  - Improve regex pattern.
> 
>  scripts/checkpatch.pl | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 31a731e..448d075 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3214,6 +3214,14 @@ sub process {
>  			     "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr);
>  		}
>  
> +# ENOSYS means "bad syscall nr" and nothing else.  This will have a small
> +# number of false positives, but assembly files are not checked, so at
> +# least the arch entry code will not trigger this warning.
> +		if ($line =~ /\bENOSYS\b/) {
> +			WARN("ENOSYS",
> +			     "ENOSYS means 'invalid syscall nr' and nothing else\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




  reply	other threads:[~2014-08-22 18:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 18:05 [PATCH v3] checkpatch.pl: New instances of ENOSYS are errors Andy Lutomirski
2014-08-22 18:14 ` Joe Perches [this message]
2015-04-10 22:30   ` Andy Lutomirski
2015-04-10 22:44     ` Joe Perches
2015-04-10 22:56       ` 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=1408731270.17241.12.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --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;
as well as URLs for NNTP newsgroup(s).