From d7fe8065ad891a2ad38b73ff10b97d08f0fb3b0b Mon Sep 17 00:00:00 2001 From: Sam Bobroff Date: Thu, 16 Apr 2015 12:44:39 -0700 Subject: [PATCH] checkpatch: improve operator spacing check Code such as: x = timercmp(&now, &end, <); Will currently trigger a checkpatch error. e.g. ERROR: spaces required around that '<' This is because the "Ignore operators passed as parameters" check looks only for a comma following the operator. Improve the check by also looking for a close parenthesis. Signed-off-by: Sam Bobroff Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6c11cb61e9f4..78a951f80706 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3652,7 +3652,7 @@ sub process { # Ignore operators passed as parameters. if ($op_type ne 'V' && - $ca =~ /\s$/ && $cc =~ /^\s*,/) { + $ca =~ /\s$/ && $cc =~ /^\s*[,\)]/) { # # Ignore comments # } elsif ($op =~ /^$;+$/) { -- 2.30.2