All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: shailendra.v@samsung.com
Cc: Joe Perches <joe@perches.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts:checkpatch - correct the error message during check
Date: Fri, 30 Oct 2015 12:56:22 +0000	[thread overview]
Message-ID: <20151030125622.GD13734@bark> (raw)
In-Reply-To: <1446204304-23107-1-git-send-email-shailendra.v@samsung.com>

On Fri, Oct 30, 2015 at 04:55:04PM +0530, shailendra.v@samsung.com wrote:
> From: Shailendra Verma <shailendra.v@samsung.com>
> 
> Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
> ---
>  scripts/checkpatch.pl | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index c5ec977..b2436d3 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3169,21 +3169,21 @@ sub process {
>  		}
>  
>  # check for global initialisers.
> -		if ($line =~ /^\+$Type\s*$Ident(?:\s+$Modifier)*\s*=\s*(?:0|NULL|false)\s*;/) {
> +		if ($line =~ /^\+$Type\s*$Ident(?:\s+$Modifier)*\s*=\s*(0x0|0|NULL|false)\s*;/) {
>  			if (ERROR("GLOBAL_INITIALISERS",
> -				  "do not initialise globals to 0 or NULL\n" .
> +				  "do not initialise globals to $1\n" .
>  				      $herecurr) &&
>  			    $fix) {
> -				$fixed[$fixlinenr] =~ s/(^.$Type\s*$Ident(?:\s+$Modifier)*)\s*=\s*(0|NULL|false)\s*;/$1;/;
> +				$fixed[$fixlinenr] =~ s/(^.$Type\s*$Ident(?:\s+$Modifier)*)\s*=\s*(0x0|0|NULL|false)\s*;/$1;/;
>  			}
>  		}
>  # check for static initialisers.
> -		if ($line =~ /^\+.*\bstatic\s.*=\s*(0|NULL|false)\s*;/) {
> +		if ($line =~ /^\+.*\bstatic\s.*=\s*(0x0|0|NULL|false)\s*;/) {
>  			if (ERROR("INITIALISED_STATIC",
> -				  "do not initialise statics to 0 or NULL\n" .
> +				  "do not initialise statics to $1\n" .
>  				      $herecurr) &&
>  			    $fix) {
> -				$fixed[$fixlinenr] =~ s/(\bstatic\s.*?)\s*=\s*(0|NULL|false)\s*;/$1;/;
> +				$fixed[$fixlinenr] =~ s/(\bstatic\s.*?)\s*=\s*(0x0|0|NULL|false)\s*;/$1;/;
>  			}
>  		}

I guess that looks ok.  Joe you don't know of anyone relying on the form
of the error do you (I do not)?

-apw

  reply	other threads:[~2015-10-30 12:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <no@samsung.com>
2015-10-30 11:25 ` [PATCH] scripts:checkpatch - correct the error message during check shailendra.v
2015-10-30 12:56   ` Andy Whitcroft [this message]
2015-10-30 15:29     ` Joe Perches
2015-10-30 19:05     ` [PATCH] checkpatch: Improve the unnecessary initialisers tests Joe Perches
2015-06-05 17:10 [PATCH] scripts:checkpatch - correct the error message during check Shailendra Verma
  -- strict thread matches above, loose matches on Subject: below --
2015-06-05 13:55 Shailendra Verma
2015-06-05 15:15 ` Joe Perches
     [not found]   ` <CA+tKcn9Mc-s=bD3KPQ=E=+yB=Sgx65yi6EUE_Qe7OiC4JCzEJg@mail.gmail.com>
2015-06-05 15:40     ` Joe Perches

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=20151030125622.GD13734@bark \
    --to=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shailendra.v@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.