From patchwork Fri Dec 18 12:59:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 58661 Delivered-To: patches@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp1008589lbb; Fri, 18 Dec 2015 04:59:34 -0800 (PST) X-Received: by 10.194.11.66 with SMTP id o2mr4417982wjb.103.1450443574051; Fri, 18 Dec 2015 04:59:34 -0800 (PST) Return-Path: Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id 7si11969872wmp.86.2015.12.18.04.59.33 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 18 Dec 2015 04:59:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1a9ud9-0003oI-4P; Fri, 18 Dec 2015 12:59:31 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Blue Swirl , Paolo Bonzini Subject: [PATCH] scripts/checkpatch.pl: Don't allow special cases of unspaced operators Date: Fri, 18 Dec 2015 12:59:31 +0000 Message-Id: <1450443571-14621-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 The checkpatch.pl script has a special case to permit the following operators to have no spaces around them: << >> & ^ | + - * / % QEMU style prefers all operators to consistently have spacing around them, so remove this special case handling. This avoids reviewers having to manually note it during code review. Signed-off-by: Peter Maydell --- I actually thought failing to point out the lack of spaces was a checkpatch parsing bug until I looked in the source and found it was deliberate... I say "QEMU style prefers", but possibly what I actually mean is "I prefer" ? Does anybody want to defend the unspaced versions? scripts/checkpatch.pl | 13 ------------- 1 file changed, 13 deletions(-) -- 1.9.1 diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b0f6e11..efca817 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1890,19 +1890,6 @@ sub process { ERROR("space prohibited after that '$op' $at\n" . $hereptr); } - - # << and >> may either have or not have spaces both sides - } elsif ($op eq '<<' or $op eq '>>' or - $op eq '&' or $op eq '^' or $op eq '|' or - $op eq '+' or $op eq '-' or - $op eq '*' or $op eq '/' or - $op eq '%') - { - if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) { - ERROR("need consistent spacing around '$op' $at\n" . - $hereptr); - } - # A colon needs no spaces before when it is # terminating a case value or a label. } elsif ($opv eq ':C' || $opv eq ':L') {