+ checkpatch-report-missing-spaces-around-trigraphs-with-strict.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: + checkpatch-report-missing-spaces-around-trigraphs-with-strict.patch added to -mm tree
To: joe@xxxxxxxxxxx,josh@xxxxxxxxxxxxxxxx
From: akpm@xxxxxxxxxxxxxxxxxxxx
Date: Tue, 17 Sep 2013 14:51:41 -0700


The patch titled
     Subject: checkpatch: report missing spaces around trigraphs with --strict
has been added to the -mm tree.  Its filename is
     checkpatch-report-missing-spaces-around-trigraphs-with-strict.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-report-missing-spaces-around-trigraphs-with-strict.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-report-missing-spaces-around-trigraphs-with-strict.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Joe Perches <joe@xxxxxxxxxxx>
Subject: checkpatch: report missing spaces around trigraphs with --strict

Spaces around trigraphs are specified by CodingStyle but checkpatch is
currently silent about them because there are many current instances
without them.

Make missing spaces around trigraphs a --strict message.

Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
Reviewed-by: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/checkpatch.pl |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff -puN scripts/checkpatch.pl~checkpatch-report-missing-spaces-around-trigraphs-with-strict scripts/checkpatch.pl
--- a/scripts/checkpatch.pl~checkpatch-report-missing-spaces-around-trigraphs-with-strict
+++ a/scripts/checkpatch.pl
@@ -2838,7 +2838,7 @@ sub process {
 				\+=|-=|\*=|\/=|%=|\^=|\|=|&=|
 				=>|->|<<|>>|<|>|=|!|~|
 				&&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%|
-				\?|:
+				\?:|\?|:
 			}x;
 			my @elements = split(/($ops|;)/, $opline);
 
@@ -3061,15 +3061,13 @@ sub process {
 					    	$ok = 1;
 					}
 
-					# Ignore ?:
-					if (($opv eq ':O' && $ca =~ /\?$/) ||
-					    ($op eq '?' && $cc =~ /^:/)) {
-					    	$ok = 1;
-					}
-
+					# messages are ERROR, but ?: are CHK
 					if ($ok == 0) {
-						if (ERROR("SPACING",
-							  "spaces required around that '$op' $at\n" . $hereptr)) {
+						my $msg_type = \&ERROR;
+						$msg_type = \&CHK if (($op eq '?:' || $op eq '?' || $op eq ':') && $ctx =~ /VxV/);
+
+						if (&{$msg_type}("SPACING",
+								 "spaces required around that '$op' $at\n" . $hereptr)) {
 							$good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " ";
 							if (defined $fix_elements[$n + 2]) {
 								$fix_elements[$n + 2] =~ s/^\s+//;
_

Patches currently in -mm which might be from joe@xxxxxxxxxxx are

checkpatch-make-extern-in-h-prototypes-quieter.patch
kernel-timerc-convert-kmalloc_nodegfp_zero-to-kzalloc_node.patch
ksm-remove-redundant-__gfp_zero-from-kcalloc.patch
checkpatch-report-missing-spaces-around-trigraphs-with-strict.patch
linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux