Re: [PATCH] staging: nvec: Silence unused argument warning in NVEC_PHD macro

From: Mohammed Guermoud
Date: Mon Aug 18 2025 - 15:53:37 EST


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@xxxxxxxxxxxxxx> wrote:
>
> Hi Mohammed,
>
> On Mon, 18 Aug 2025 at 17:10, Mohammed Guermoud
> <mohammed.guermoud@xxxxxxxxx> 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@xxxxxxxxx>
>
> 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@xxxxxxxxxxxxxx
>
> 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