Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp943193pxf; Wed, 7 Apr 2021 15:42:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv4WmVneOp+7vzzMLxEvTDgN7dWSkw7fWSRXYjDd7MUV3+OEO32LmWTEKQIs+rSg2QosLw X-Received: by 2002:a17:906:aad4:: with SMTP id kt20mr6518638ejb.367.1617835328118; Wed, 07 Apr 2021 15:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617835328; cv=none; d=google.com; s=arc-20160816; b=e4lXaq09OHwwwE33eIH4SN25BPRyvSaayoP4jwcRIhcSZiUE3GtQvna+Q2zNWwu5vc qwWCiid3E1h/X6d3VhPymxEIGJ8/QMWdVbe0CmZHOlDEIK2Z78McNRsgS8IDaAxDnmwm Op025REJWu36xYc5EoCU76+Hb0pNwWeZJkShiH5TWOGw3T0i5faDsM94doqz3NtVX3c2 UmiFO577WToen2gaLPguR/oA9384UKiNJK7IVgrnJ7ZNxeKVlqiwR2VNHR7/7/U8wq8r Sx4bCZHpZ0Xi/mtcvyW1BFLnyx84Q6LrcijrDWVyo551aUE2fI1Spb57Ku2EksOmWxvd TC9w== 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 :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=951FJXHytmole3TCfQuJDw522v0Y3Sh7+fEHEPaP1yw=; b=IuAo9LQXeH9OLqBn7ngM3lXNv6GWLcD3OKv04JbsQ4h1P3Hax1ePRXubrobXhsIDdk OoXi8l7o9CjCcGjRyMlpFVzLWAzxJRE081KWC9oyIvEWUDVfy+T2FOs9QXIwsXbY5Rug 7WWCoCbwPPkwGxxDoRILoox2M5LQirFuVpgizq9rTf7ECtpkEX9Fce2ixCkZuDkTehrb XTw5Q8t5wimxscLHUuSd7ITtBzy88izreUcO7pqWzgARZeOQn0IyLnxN+vn8LzJeUcje 5l9c+U2cbtHWEnBxSpjo4aNtmt2uOGy+g306K6hZTV0tp0q6kKKZqCcoxgQc7CmpBVNb z1Qw== 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 s16si5176947ejr.498.2021.04.07.15.41.44; Wed, 07 Apr 2021 15:42:08 -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 S1354949AbhDGRsF (ORCPT + 99 others); Wed, 7 Apr 2021 13:48:05 -0400 Received: from smtprelay0035.hostedemail.com ([216.40.44.35]:49524 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233520AbhDGRsD (ORCPT ); Wed, 7 Apr 2021 13:48:03 -0400 Received: from omf04.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id BEEF91813F559; Wed, 7 Apr 2021 17:47:52 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA id EF0D8D1517; Wed, 7 Apr 2021 17:47:51 +0000 (UTC) Message-ID: <1bbc36d5fbc74f11b2a1c0d3255bb3394a048a20.camel@perches.com> Subject: Re: [RESEND PATCH v1] checkpatch: exclude four preprocessor sub-expressions from MACRO_ARG_REUSE From: Joe Perches To: Vincent Mailhol , Andy Whitcroft , linux-kernel@vger.kernel.org, Andrew Morton Date: Wed, 07 Apr 2021 10:47:50 -0700 In-Reply-To: <20210407105042.25380-1-mailhol.vincent@wanadoo.fr> References: <20210407105042.25380-1-mailhol.vincent@wanadoo.fr> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF0D8D1517 X-Spam-Status: No, score=0.10 X-Stat-Signature: gz3fjhraxu55boyfniturqsod18efez6 X-Rspamd-Server: rspamout04 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19u7TqTAX6xrGu7WV97zsm4NR5e6PBQWFs= X-HE-Tag: 1617817671-456947 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-04-07 at 19:50 +0900, Vincent Mailhol wrote: > __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 Acked-by: Joe Perches > --- > ?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;