Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2790380pxf; Sun, 21 Mar 2021 07:01:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7dTAh+c7qP1SzcZ/ZGp95ygAc6pE3ySbbIRkGgxIownb0lXmsC0+RTtxlVIPjDeV/tCTj X-Received: by 2002:a17:906:1ecc:: with SMTP id m12mr14501271ejj.4.1616335315757; Sun, 21 Mar 2021 07:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616335315; cv=none; d=google.com; s=arc-20160816; b=lRnRSh4ETlttB4hnBRh/sTeL7TwiFAKl2DOJtexEi2GkZjIz9YRCRlf3YC+vdJ9sgt 0QfZBWZMIxBbBjWnKtMToMM7XrdcygeOBf55H4zUIx1vV8dB9MeD0vQTZCD3ObiDLsv9 4BzmIo4gOvLRt94Jbf2ROGmpvnBi4EcaI7WN85H8G6PqWKoA0I4wSIQtuJUSla9c6QVX TV115HluHqtLo+9doW4eViTJubk6dh/ETaULdhS/4Oz9U+nqn3FFLczxkHTTtT3sXRNY hn99TK/9V7piNLQz7UW33cGQKSJnxL2A5KV36FumTJgNZWTff5I5tLtxXdnia8mrwwpf 6J9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=SfZrZCdEKGy0y/GWdwSAxBccTFEmSrH7Ci7vQIzOxzs=; b=fjo74jrONtmiPqum1ltmK9cPdyOlW1lvXNG+14/Gmv4QjURR2Bcn/xFLX0yAm95JfA aU1VcRM50RaNNzdpq1qYqNcb5vxN9ob+J3JdQgDE4IStJERAXEiCfJg8lQ/JtTDUJUnE 7EMt9nriEJj2G284b+NkMwWXpon0Ri3s1XIbMpJNxCxq5CMh11On26/r1sCRtakKeqEo 46L0uPfLZ9IOiu/lDivG2WVhokUgkFiOXIaRVJurxuehBloFFBjBXWEQB0lneyf35cAO irQwOgDAa+9zh5e68rhODTHQQhPSAvW6TXo5XeatVUIm2EnxsfJlzgFLodKI11L9d1De 7zYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k1si9606494ejp.353.2021.03.21.07.01.32; Sun, 21 Mar 2021 07:01:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbhCUNxk (ORCPT + 99 others); Sun, 21 Mar 2021 09:53:40 -0400 Received: from smtp07.smtpout.orange.fr ([80.12.242.129]:43124 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbhCUNxU (ORCPT ); Sun, 21 Mar 2021 09:53:20 -0400 Received: from tomoyo.flets-east.jp ([153.202.107.157]) by mwinf5d13 with ME id j1t8240033PnFJp031tGHl; Sun, 21 Mar 2021 14:53:19 +0100 X-ME-Helo: tomoyo.flets-east.jp X-ME-Auth: bWFpbGhvbC52aW5jZW50QHdhbmFkb28uZnI= X-ME-Date: Sun, 21 Mar 2021 14:53:19 +0100 X-ME-IP: 153.202.107.157 From: Vincent Mailhol To: Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org Cc: Vincent Mailhol Subject: [RESEND PATCH v1] checkpatch: exclude four preprocessor sub-expressions from MACRO_ARG_REUSE Date: Sun, 21 Mar 2021 22:53:05 +0900 Message-Id: <20210321135305.543537-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __must_be_array, offsetof, sizeof_field and __stringify are all preprocessor macros and do not evaluate their arguments. As such, it is safe not to warn when arguments are being reused in those four sub-expressions. Exclude those so that they can pass checkpatch. Signed-off-by: Vincent Mailhol --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index df8b23dc1eb0..25ee4fd5b118 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5736,7 +5736,7 @@ sub process { next if ($arg =~ /\.\.\./); next if ($arg =~ /^type$/i); my $tmp_stmt = $define_stmt; - $tmp_stmt =~ s/\b(sizeof|typeof|__typeof__|__builtin\w+|typecheck\s*\(\s*$Type\s*,|\#+)\s*\(*\s*$arg\s*\)*\b//g; + $tmp_stmt =~ s/\b(__must_be_array|offsetof|sizeof|sizeof_field|__stringify|typeof|__typeof__|__builtin\w+|typecheck\s*\(\s*$Type\s*,|\#+)\s*\(*\s*$arg\s*\)*\b//g; $tmp_stmt =~ s/\#+\s*$arg\b//g; $tmp_stmt =~ s/\b$arg\s*\#\#//g; my $use_cnt = () = $tmp_stmt =~ /\b$arg\b/g; -- 2.26.2