[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cf0501d3245554150b4a19ced0401228fc58b335.camel@perches.com>
Date: Thu, 20 Mar 2025 20:14:54 -0700
From: Joe Perches <joe@...ches.com>
To: Jim Cromie <jim.cromie@...il.com>, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
intel-gfx-trybot@...ts.freedesktop.org, Andrew Morton
<akpm@...ux-foundation.org>
Cc: jbaron@...mai.com, gregkh@...uxfoundation.org, ukaszb@...omium.org,
louis.chauvet@...tlin.com, daniel.vetter@...ll.ch,
tvrtko.ursulin@...ux.intel.com, jani.nikula@...el.com,
ville.syrjala@...ux.intel.com, Andy Whitcroft <apw@...onical.com>,
Dwaipayan Ray <dwaipayanray1@...il.com>, Lukas Bulwahn
<lukas.bulwahn@...il.com>
Subject: Re: [PATCH v2 34/59] checkpatch: dont warn about unused macro arg
on empty body
On Thu, 2025-03-20 at 12:52 -0600, Jim Cromie wrote:
> we currently get:
> WARNING: Argument 'name' is not used in function-like macro
> on:
> #define DRM_CLASSMAP_USE(name) /* nothing here */
>
> Following this advice is wrong here, and shouldn't be fixed by
> ignoring args altogether; the macro should properly fail if invoked
> with 0 or 2+ args.
>
> cc: Andy Whitcroft <apw@...onical.com>
> cc: Joe Perches <joe@...ches.com>
> cc: Dwaipayan Ray <dwaipayanray1@...il.com>
> cc: Lukas Bulwahn <lukas.bulwahn@...il.com>
> Signed-off-by: Jim Cromie <jim.cromie@...il.com>
Completely sensible, thanks Jim.
> ---
> scripts/checkpatch.pl | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 7b28ad331742..0c4f578ea6e7 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -6037,7 +6037,7 @@ sub process {
> }
>
> # check if this is an unused argument
> - if ($define_stmt !~ /\b$arg\b/) {
> + if ($define_stmt !~ /\b$arg\b/ && $define_stmt) {
> WARN("MACRO_ARG_UNUSED",
> "Argument '$arg' is not used in function-like macro\n" . "$herectx");
> }
Powered by blists - more mailing lists