From patchwork Thu Feb 4 16:32:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Down X-Patchwork-Id: 12067751 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=-17.2 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, USER_AGENT_SANE_1 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 62890C433DB for ; Thu, 4 Feb 2021 16:32:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F1D6664F42 for ; Thu, 4 Feb 2021 16:32:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F1D6664F42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8F2346B0006; Thu, 4 Feb 2021 11:32:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C8776B006E; Thu, 4 Feb 2021 11:32:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 804A76B0072; Thu, 4 Feb 2021 11:32:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6B06A6B0006 for ; Thu, 4 Feb 2021 11:32:45 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 38EFE82499B9 for ; Thu, 4 Feb 2021 16:32:45 +0000 (UTC) X-FDA: 77781129090.18.rest71_2205343275dd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 01D8D100EE24F for ; Thu, 4 Feb 2021 16:32:44 +0000 (UTC) X-HE-Tag: rest71_2205343275dd X-Filterd-Recvd-Size: 3815 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Feb 2021 16:32:44 +0000 (UTC) Received: by mail-wr1-f41.google.com with SMTP id c12so4230753wrc.7 for ; Thu, 04 Feb 2021 08:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=yFK+1MV3m0cXtRceuXKqnLy2r2w69ziUIu2mcYHCeP8=; b=Ti2FiS0Gse4C2Jz5tafEqiwdl22BoyaRWSkwfAPqGsEj4UpC3HKkuwbllggqVffsmL Ipm0NRxqROFF3+EdE+4ETzRl49fpw6pQ8x6unN+6RpL6aqJG6cA07zb7OhiZ7KiUkrEu jj/CmrbdFMT+OtJzCmvXW4FeSjWs/ZpBkDdng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=yFK+1MV3m0cXtRceuXKqnLy2r2w69ziUIu2mcYHCeP8=; b=OhBGnWRVcwvo1rxoFEFmmp5eNnGHoF7PaQsTXxkC+7cpuwhs4IURgJ44LbBBpELV1Z aQUB2R7Nfocew1WZGnPe48mfyHkHo7COcvfXVABkBW7peDXybmgt47kmsxML2KeLXFDu VLfeqFHbI9czvXNDPnUBUa8Dd/lB+s+sBXcK8HeRis3SbzbZ3WnuySb95PyowtesgUn7 jEnvXV8IYAHS3zeCR6/nLoe4sEeKGRYNzPfAfs7IH/Adrnmtf7zApadULbfgYGs9vbEZ LhYIahOtNGF9puwOVybdYEDZ7+Aqu6ZwU5zQ/faxUyJqaAvFvJu10Na+zIV8cjDD1un9 KGhQ== X-Gm-Message-State: AOAM531XmxIpdudWagYKSCReF03NoLTV8fTFEYspCVOLW3eXMY8TlHA8 Dgj+joq6bauSoz3NbPV/X4G4ZQ== X-Google-Smtp-Source: ABdhPJxcOpShSPrft7TF0SBKswX3MoQqgRczF9Bq+f9/NxxXThyuA9OUEmw5G2WKxDcOmK9+hvk7xA== X-Received: by 2002:a5d:5005:: with SMTP id e5mr202698wrt.82.1612456363231; Thu, 04 Feb 2021 08:32:43 -0800 (PST) Received: from localhost ([2a01:4b00:8432:8a00:63de:dd93:20be:f460]) by smtp.gmail.com with ESMTPSA id p5sm5923205wmq.3.2021.02.04.08.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 08:32:42 -0800 (PST) Date: Thu, 4 Feb 2021 16:32:42 +0000 From: Chris Down To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH] checkpatch: Don't warn about colon termination in linker scripts Message-ID: MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/2.0.5 (da5e3282) (2021-01-21) 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: 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/ Signed-off-by: Chris Down Cc: Andrew Morton --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4f8494527139..3bcffc5574ae 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5046,7 +5046,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]);