From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9udJ-000867-Nv for qemu-devel@nongnu.org; Fri, 18 Dec 2015 07:59:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9udI-0007OT-QQ for qemu-devel@nongnu.org; Fri, 18 Dec 2015 07:59:41 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:59161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9udI-0007H7-Jw for qemu-devel@nongnu.org; Fri, 18 Dec 2015 07:59:40 -0500 From: Peter Maydell Date: Fri, 18 Dec 2015 12:59:31 +0000 Message-Id: <1450443571-14621-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] scripts/checkpatch.pl: Don't allow special cases of unspaced operators List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Paolo Bonzini , patches@linaro.org 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(-) 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') { -- 1.9.1