From patchwork Tue Jan 8 00:55:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 1021674 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43YYhK0RVzz9sDT for ; Tue, 8 Jan 2019 11:55:11 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 76E1784F5A; Tue, 8 Jan 2019 00:55:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vm9RvzkLRedz; Tue, 8 Jan 2019 00:55:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id BFEE085BC9; Tue, 8 Jan 2019 00:55:08 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AFB0B1C3353 for ; Tue, 8 Jan 2019 00:55:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A18C985BC9 for ; Tue, 8 Jan 2019 00:55:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VVWZvWkSxtag for ; Tue, 8 Jan 2019 00:55:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by whitealder.osuosl.org (Postfix) with ESMTPS id 782EC85BD6 for ; Tue, 8 Jan 2019 00:55:05 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2019 16:55:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,451,1539673200"; d="scan'208";a="112916282" Received: from jekeller-desk.amr.corp.intel.com ([10.166.244.182]) by fmsmga007.fm.intel.com with ESMTP; 07 Jan 2019 16:55:04 -0800 From: Jacob Keller To: Intel Wired LAN Date: Mon, 7 Jan 2019 16:55:02 -0800 Message-Id: <20190108005502.4210-1-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.18.0.219.gaf81d287a9da Subject: [Intel-wired-lan] [PATCH] checkpatch: don't complain about LEADING_SPACE in CPP continuations X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" If a C preprocessor macro is continued onto another line using a backslash line continuation, checkpatch.pl will complain about leading spaces used to indent the multiline conditional. This leads to warnings similar to the following WARNING: please, no spaces at the start of a line #107: FILE: arch/m68k/include/asm/mcfgpio.h:107: + defined(CONFIG_M53xx) || defined(CONFIG_M54xx) || \$ WARNING: please, no spaces at the start of a line #108: FILE: arch/m68k/include/asm/mcfgpio.h:108: + defined(CONFIG_M5441x)$ To fix these warnings, modify the test to also exclude lines which end in a backslach continuation, as these lines should only occur within a multiline C Preprocessor check. Signed-off-by: Jacob Keller --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e16ce8b0c462..871bb37876b2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3361,7 +3361,8 @@ sub process { # 1) within comments # 2) indented preprocessor commands # 3) hanging labels - if ($rawline =~ /^\+ / && $line !~ /^\+ *(?:$;|#|$Ident:)/) { + if ($rawline =~ /^\+ / && $line !~ /^\+ *(?:$;|#|$Ident:)/ && + $prevline !~ /\\$/) { my $herevet = "$here\n" . cat_vet($rawline) . "\n"; if (WARN("LEADING_SPACE", "please, no spaces at the start of a line\n" . $herevet) &&