From patchwork Fri Feb 26 01:22:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12105555 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A502C433E6 for ; Fri, 26 Feb 2021 01:22:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A61A464EE2 for ; Fri, 26 Feb 2021 01:22:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A61A464EE2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3CFDE6B0104; Thu, 25 Feb 2021 20:22:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A69E8D0005; Thu, 25 Feb 2021 20:22:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BD328D0003; Thu, 25 Feb 2021 20:22:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0155.hostedemail.com [216.40.44.155]) by kanga.kvack.org (Postfix) with ESMTP id 11BC66B0104 for ; Thu, 25 Feb 2021 20:22:07 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D89D8B7A9 for ; Fri, 26 Feb 2021 01:22:06 +0000 (UTC) X-FDA: 77858667852.11.D7CB371 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP id C32954080F44 for ; Fri, 26 Feb 2021 01:22:01 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4241E64F03; Fri, 26 Feb 2021 01:22:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1614302525; bh=Fi6yOwzC/g1bydpzhmjbQY9sFAaDnrS8jdiciF8/vqc=; h=Date:From:To:Subject:In-Reply-To:From; b=NS7hivYbD5V9DymQJsnzBvlT6g3PkVmcvKemoBo2o6HATZWhm/rRzFmQmbOAYWdma ga2Spct9nTOKCjhWokLILMvLJpPGEX/+bqHfpx9GNSAHF4Yme8SIMQV5woZuc2HXiG Nk8a3IdkLR7EvXLXc/hKGvtDxIr9bSRyYi2+m4lM= Date: Thu, 25 Feb 2021 17:22:04 -0800 From: Andrew Morton To: akpm@linux-foundation.org, chris@chrisdown.name, joe@perches.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 106/118] checkpatch: don't warn about colon termination in linker scripts Message-ID: <20210226012204.xB5hJqZXG%akpm@linux-foundation.org> In-Reply-To: <20210225171452.713967e96554bb6a53e44a19@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C32954080F44 X-Stat-Signature: k34m1gb83asnyp676citz8jf1444g95c Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614302521-237255 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Chris Down Subject: checkpatch: don't warn about colon termination in linker scripts This check erroneously flags cases like the one in my recent printk enumeration patch[0], where the spaces are syntactic, and `section:' vs. `section :' is syntactically important: ERROR: space prohibited before that ':' (ctx:WxW) #258: FILE: include/asm-generic/vmlinux.lds.h:314: + .printk_fmts : AT(ADDR(.printk_fmts) - LOAD_OFFSET) { 0: https://lore.kernel.org/patchwork/patch/1375749/ Link: https://lkml.kernel.org/r/YBwhqsc2TIVeid3t@chrisdown.name Link: https://lkml.kernel.org/r/YB6UsjCOy1qrrlSD@chrisdown.name Signed-off-by: Chris Down Acked-by: Joe Perches Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/scripts/checkpatch.pl~checkpatch-dont-warn-about-colon-termination-in-linker-scripts +++ a/scripts/checkpatch.pl @@ -5044,7 +5044,7 @@ sub process { # A colon needs no spaces before when it is # terminating a case value or a label. } elsif ($opv eq ':C' || $opv eq ':L') { - if ($ctx =~ /Wx./) { + if ($ctx =~ /Wx./ and $realfile !~ m@.*\.lds\.h$@) { if (ERROR("SPACING", "space prohibited before that '$op' $at\n" . $hereptr)) { $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]);