public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Rabin Vincent <rabin.vincent@stericsson.com>
Cc: <linux-kernel@vger.kernel.org>,
	Andy Whitcroft <apw@canonical.com>,
	Linus Walleij <linus.walleij@stericsson.com>
Subject: Re: [PATCH] checkpatch: check for incorrect permissions
Date: Thu, 12 Aug 2010 14:02:22 -0700	[thread overview]
Message-ID: <20100812140222.d3dedf91.akpm@linux-foundation.org> (raw)
In-Reply-To: <1281590145-30708-1-git-send-email-rabin.vincent@stericsson.com>

On Thu, 12 Aug 2010 10:45:45 +0530
Rabin Vincent <rabin.vincent@stericsson.com> wrote:

> Throw an error when a source file has been given execute permissions
> using the mode change line present in git diffs.  Also alow the filename
> matching to use the "diff" line in addition to the "+++" line, since the
> mode change lines appear before any "+++" lines.
> 
> Cc: Andy Whitcroft <apw@canonical.com>
> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
> ---
>  scripts/checkpatch.pl |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 2039acd..4c35cb9 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1308,7 +1308,7 @@ sub process {
>  		$here = "#$realline: " if ($file);
>  
>  		# extract the filename as it passes
> -		if ($line=~/^\+\+\+\s+(\S+)/) {
> +		if ($line=~/^\+\+\+\s+(\S+)/ || $line=~/^diff\s.*?(\S+)$/) {

Breakage.  This causes the false warning:

WARNING: patch prefix 'drivers' exists, appears to be a -p0 patch

to be emitted when processing the below patch:



From: Dan Carpenter <error27@gmail.com>

copy_to_user() returns the number of bytes remaining but we want to return
a negative error code on errors.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: "Michael H. Warfield" <mhw@wittsend.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/char/ip2/ip2main.c |    2 ++
 1 file changed, 2 insertions(+)

diff -puN drivers/char/ip2/ip2main.c~ip2-return-efault-on-copy_to_user-errors drivers/char/ip2/ip2main.c
--- a/drivers/char/ip2/ip2main.c~ip2-return-efault-on-copy_to_user-errors
+++ a/drivers/char/ip2/ip2main.c
@@ -2930,6 +2930,8 @@ ip2_ipl_ioctl (struct file *pFile, UINT 
 				if ( pCh )
 				{
 					rc = copy_to_user(argp, pCh, sizeof(i2ChanStr));
+					if (rc)
+						rc = -EFAULT;
 				} else {
 					rc = -ENODEV;
 				}
_


  reply	other threads:[~2010-08-12 21:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12  5:15 [PATCH] checkpatch: check for incorrect permissions Rabin Vincent
2010-08-12 21:02 ` Andrew Morton [this message]
2010-08-13  4:55   ` Rabin VINCENT
2010-08-18 11:10     ` Andy Whitcroft

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=20100812140222.d3dedf91.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rabin.vincent@stericsson.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