lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025081859-shabby-sanitizer-100d@gregkh>
Date: Mon, 18 Aug 2025 08:36:27 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Mohammed Guermoud <mohammed.guermoud@...il.com>
Cc: marvin24@....de, 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

On Sun, Aug 17, 2025 at 08:24:25PM +0100, Mohammed Guermoud 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>
> ---
>  drivers/staging/nvec/nvec_ps2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c
> index 575233fa1677..7accdcafeeac 100644
> --- 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)

As Dan said, what is the warning?

And this isn't the best/proper way to handle this type of issue.  Best
is to make an inline function that does nothing, as that way you
properly check the variable types.

But, I'll push back and say why is this even needed at all?  As
NVEC_PS2_DEBUG is never defined, why not just remove them?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ