Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84731623 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

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: default avatarJoe Perches <joe@perches.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6bc080d8
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -2838,7 +2838,7 @@ sub process {
				\+=|-=|\*=|\/=|%=|\^=|\|=|&=|
				=>|->|<<|>>|<|>|=|!|~|
				&&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%|
				\?|:
				\?:|\?|:
			}x;
			my @elements = split(/($ops|;)/, $opline);

@@ -3061,14 +3061,12 @@ 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",
						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]) {