[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+Vbt5GwiaNaFEVa+U_dFe3jLpYAE+7PbTXC7jgOoqt1YqQo_Q@mail.gmail.com>
Date: Mon, 18 Aug 2025 20:52:39 +0100
From: Mohammed Guermoud <mohammed.guermoud@...il.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: marvin24@....de, gregkh@...uxfoundation.org, ac100@...ts.launchpad.net,
linux-tegra@...r.kernel.org, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: nvec: Silence unused argument warning in
NVEC_PHD macro
Hi Greg, Dan, and Geert,
Thank you all for the detailed feedback. This has been a great
learning experience.
My initial patch was incorrect and broke the build, as the test robot found.
Following Greg's advice, I will send a v2 patch that removes the
unused NVEC_PHD macro and all the places it is used.
Thanks,
Mohammed
Mohammed GUERMOUD
Software Architect
Stellantis (Formerly Groupe PSA Peugeot Citroën) - Morocco
On Mon, Aug 18, 2025 at 4:42 PM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>
> Hi Mohammed,
>
> On Mon, 18 Aug 2025 at 17:10, Mohammed Guermoud
> <mohammed.guermoud@...il.com> wrote:
> > The NVEC_PHD macro was defined with three arguments (str, buf, len)
> > that were not used in its empty body, causing a compiler warning.
> >
> > This patch silences the warning by explicitly casting the unused
> > arguments to (void), making the intent clear without changing
> > functionality.
> >
> > Signed-off-by: Mohammed Guermoud <mohammed.guermoud@...il.com>
>
> Thanks for your patch!
>
> > --- a/drivers/staging/nvec/nvec_ps2.c
> > +++ b/drivers/staging/nvec/nvec_ps2.c
> > @@ -28,7 +28,7 @@
> > print_hex_dump(KERN_DEBUG, str, DUMP_PREFIX_NONE, \
> > 16, 1, buf, len, false)
> > #else
> > -#define NVEC_PHD(str, buf, len) do { } while (0)
> > +#define NVEC_PHD(str, buf, len) do { (void)str; (void)buf; (void)len; } while (0)
> > #endif
> >
> > enum ps2_subcmds {
>
> The proper solution would be to remove the custom NVEC_PHD() macro (and
> NVEC_PS2_DEBUG), and just call print_hex_dump_debug() directly instead.
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
Powered by blists - more mailing lists