linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shailendra Verma <shailendra.capricorn@gmail.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org,
	Shailendra Verma <shailendra.capricorn@gmail.com>
Subject: [PATCH] scripts:checkpatch - correct the error message during check
Date: Fri,  5 Jun 2015 22:40:12 +0530	[thread overview]
Message-ID: <1433524212-7607-1-git-send-email-shailendra.capricorn@gmail.com> (raw)

Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.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;/;
 			}
 		}
 
-- 
1.9.1


             reply	other threads:[~2015-06-05 17:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 17:10 Shailendra Verma [this message]
     [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
2015-10-30 15:29     ` Joe Perches
  -- 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=1433524212-7607-1-git-send-email-shailendra.capricorn@gmail.com \
    --to=shailendra.capricorn@gmail.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /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).