Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1197923lqh; Sun, 5 May 2024 22:58:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW+BhopVEhZOssFZ6sGsHjAMK5Oi02W03BYRIVw5hX+VuGkkA6CQ9CQpT4khrhgV2gvHEJsQj78qSYpQDn0jdeezLewK/KY2/XEWdcZKw== X-Google-Smtp-Source: AGHT+IH7fgGjqBWNJI5dVvOH3SKAvlx0xLzKTHzwG8TdRQHpM8ZAO85x/SRW3uUQsq1EmQzEusg0 X-Received: by 2002:a17:907:86ab:b0:a59:b004:64ed with SMTP id qa43-20020a17090786ab00b00a59b00464edmr3644151ejc.8.1714975093076; Sun, 05 May 2024 22:58:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714975093; cv=pass; d=google.com; s=arc-20160816; b=nIlTiUNTugmHmnRVIj7SSU/RL1ZrCNt/m0ph/e66H6hwpwQKTH1LfJ7NDIpaNf2dDD uoMlT+edq7ltn7BGwWXPNLyDjD34gtssUUSEqbIY1tcrwOmYOH1IQ9mrf7xg6F+eY7be zYDaJSpJzzVnS+S/e03VBIVPvLphKE6BRBhPhJf8b2TgcZajC8SOUlF777oFLa8uzVso /rqDtcu0/SnjcW6iVS8d3PF7l8jRklr9UP3YpaVAkD/NkVkHWEkLeP1q+fQCpMtcS6Za /N1soIn8hL4B5mqZEmfHMYI10dHiq7pBXV0bx7c6MjvgycbMt1u6c97NwouAjV869A11 A5bQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=z7vuzbVBcRAJtMmEpYEXs2CFU5p4zJjlHhH/Ah1dFhQ=; fh=A13dnRF5j/HVFjsd2hj0lwOjAVHwhbxztclMZpxmcBI=; b=zg3LhbtfT+nzyaKPzsYyq7GPTQ9K69Ns96SHqyuIKcODBuJEUONczahxo7rGL0colf 6kHisz4DnfXYN9I2Al2q9UjAU0MmlPSE32eYfUbj5VJHZzVn4tXLXRqnaGgtjODqAmH5 FUvLbO0w0+Xk6d5G3R17nVFHeGCopUGUHZT1YMKEgrHhN5CVbARFAK5LaEwam23z9lks dkFcIISwMHn1sSH1IH4mzWzh8vk66Deh4SpNMEKo1ZEbFbxJLJlQqTony6yl1fm1sLA9 a+SHpV36JPYJwU4sKoYYRTtUpXzMWen3YtBKPHIRCT6qT2GUFcYKLzSzgGVz4BVFiUSH j5wA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-169321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169321-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dx19-20020a170906a85300b00a59a0f6c869si2923077ejb.395.2024.05.05.22.58.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 22:58:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-169321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169321-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5E4D21F240BA for ; Mon, 6 May 2024 05:38:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F0294CB36; Mon, 6 May 2024 05:33:35 +0000 (UTC) Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 203BB4779F; Mon, 6 May 2024 05:33:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714973614; cv=none; b=fNEqgotFjvCUrQs7zrC01dHLkQdk3Ck0OP7tgQSMjeP6kU+qT0kQ+ayv728JEq0maRB2JmkmVqc7tm2IC6IpDskn9gQXFP8TCVCKtTT1dLcQ3ZoqxPiKuHtPfDt/8lGHtY+fvKsXrhm0qAQ5VqNHtHqlPIPPOP0a3eDBsLNr2OY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714973614; c=relaxed/simple; bh=du+ALvgKFi4Utr9m0V0kOjg/vAiXg0zO+2aWON7wKUk=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=G98YZQTnFLqp4Mdbqqdp3LZSypNW/71od3nV62DntOZPwWeJGrm38pGE471AqfR+rT2sBnbU9Q4//57TKkCqX4eGYOauF4GyZwX5c3ILDd451+HB+PVM9ncbH+llVf6DULKlBuMTrpyC4nBr6YHKcwgE/AASacDSqd3f6Gm1Mpg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com; spf=pass smtp.mailfrom=perches.com; arc=none smtp.client-ip=216.40.44.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perches.com Received: from omf20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D4F468059F; Mon, 6 May 2024 05:33:24 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA id 3947020027; Mon, 6 May 2024 05:33:19 +0000 (UTC) Message-ID: <5e26f82913801050afa4442dfb9a07249895ab98.camel@perches.com> Subject: Re: [PATCH RESEND v6 2/2] scripts: checkpatch: check unused parameters for function-like macro From: Joe Perches To: Barry Song <21cnbao@gmail.com>, akpm@linux-foundation.org, linux-doc@vger.kernel.org Cc: apw@canonical.com, broonie@kernel.org, chenhuacai@loongson.cn, chris@zankel.net, corbet@lwn.net, dwaipayanray1@gmail.com, herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org, linux@roeck-us.net, lukas.bulwahn@gmail.com, mac.xxn@outlook.com, sfr@canb.auug.org.au, v-songbaohua@oppo.com, workflows@vger.kernel.org, Max Filippov , Jeff Johnson , Charlemagne Lasse Date: Sun, 05 May 2024 22:33:18 -0700 In-Reply-To: <20240506014606.8638-3-21cnbao@gmail.com> References: <20240506014606.8638-1-21cnbao@gmail.com> <20240506014606.8638-3-21cnbao@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 3947020027 X-Stat-Signature: aargiw53xx4ngbwux9sg9mpkukr7qpmn X-Rspamd-Server: rspamout07 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/ciNc0vA18o/tMotMqT2SUzxIzu6KuCyw= X-HE-Tag: 1714973599-630367 X-HE-Meta: U2FsdGVkX1/JqiA/9sG38C80kL0WMT+Wa7HG6VkyYyFiZr2Xmzw9B2TJWcB+1g6q0me1a6639DMhWvjI1KPiPkUYeEqpvBOy8o6AVkTqVhkr2DA0h02dDpSt8YQdfntmWH3jbXzSiMILjBQnqtkX4/xEm6sz2JRWbUXjntie9i12CO0kKAsHtqo9DIfqDPdlkLQ48grgf2A6jcgVeul51D+1unwIEOpUQ67e/4oOAk/qjqdCI+6mdgQ+IjyMhW5Kj+JjFctAoP1sxECwVytbKSt/SS952cNbpCffu2n3UO2G1sw21Gp1QVMgTN6FF9mVf9hbCJbqRNwh1boqQBonOubnHFNc6z/Nf+qJ7d8u6XnaGb6i65gVD+gLL8rSipii4HWpQAhPuOh1/4pEEnzG0s6gkXCmoJREmgLMgV5nrKoMxWd6O6YxDw== On Mon, 2024-05-06 at 13:46 +1200, Barry Song wrote: > From: Xining Xu >=20 > If function-like macros do not utilize a parameter, it might result in a > build warning. In our coding style guidelines, we advocate for utilizing > static inline functions to replace such macros. This patch verifies > compliance with the new rule. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -6040,6 +6040,12 @@ sub process { > CHK("MACRO_ARG_PRECEDENCE", > "Macro argument '$arg' may be better as '($arg)' to avoid prece= dence issues\n" . "$herectx"); > } > + > +# check if this is an unused argument > + if ($define_stmt !~ /\b$arg\b/) { > + WARN("MACRO_ARG_UNUSED", > + "Argument '$arg' is not used in function-like macro\n" . "$herectx= "); trivia: This should be aligned to the open parenthesis. Otherwise: Acked-by: Joe Perches