Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbbDGDhF (ORCPT ); Mon, 6 Apr 2015 23:37:05 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:34981 "EHLO e23smtp09.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753054AbbDGDhC (ORCPT ); Mon, 6 Apr 2015 23:37:02 -0400 From: Sam Bobroff To: linux-kernel@vger.kernel.org Cc: apw@canonical.com, joe@perches.com Subject: [PATCH 1/1] checkpatch: improve operator spacing check Date: Tue, 7 Apr 2015 13:36:00 +1000 Message-Id: <203326aa74b4de17ebbc27acfde0790f5ec48504.1428377753.git.sam.bobroff@au1.ibm.com> X-Mailer: git-send-email 1.7.10.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15040703-0033-0000-0000-0000014A4599 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1116 Lines: 37 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 --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d124359..f65c4de 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3565,7 +3565,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 =~ /^$;+$/) { -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/