Re: [PATCH] staging: nvec: Silence unused argument warning in NVEC_PHD macro
From: Geert Uytterhoeven
Date: Mon Aug 18 2025 - 11:39:49 EST
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