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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250328131513.GB20836@ziepe.ca>
Date: Fri, 28 Mar 2025 10:15:13 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Leon Romanovsky <leon@...nel.org>,
	Patrisious Haddad <phaddad@...dia.com>,
	Arnd Bergmann <arnd@...db.de>, Mark Bloch <mbloch@...dia.com>,
	Tariq Toukan <tariqt@...dia.com>, Jakub Kicinski <kuba@...nel.org>,
	Moshe Shemesh <moshe@...dia.com>, linux-rdma@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] RDMA/mlx5: hide unused code

On Fri, Mar 28, 2025 at 02:10:17PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> After a recent rework, a few 'static const' objects have become unused:
> 
> In file included from drivers/infiniband/hw/mlx5/fs.c:27:
> drivers/infiniband/hw/mlx5/fs.c:26:28: error: 'mlx5_ib_object_MLX5_IB_OBJECT_STEERING_ANCHOR' defined but not used [-Werror=unused-const-variable=]
> include/rdma/uverbs_named_ioctl.h:52:47: note: in expansion of macro 'UVERBS_OBJECT'
>    52 |         static const struct uverbs_object_def UVERBS_OBJECT(_object_id) = {    \
>       |                                               ^~~~~~~~~~~~~
> drivers/infiniband/hw/mlx5/fs.c:3457:1: note: in expansion of macro 'DECLARE_UVERBS_NAMED_OBJECT'
>  3457 | DECLARE_UVERBS_NAMED_OBJECT(
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> drivers/infiniband/hw/mlx5/fs.c:26:28: error: 'mlx5_ib_object_MLX5_IB_OBJECT_FLOW_MATCHER' defined but not used [-Werror=unused-const-variable=]
> include/rdma/uverbs_named_ioctl.h:52:47: note: in expansion of macro 'UVERBS_OBJECT'
>    52 |         static const struct uverbs_object_def UVERBS_OBJECT(_object_id) = {    \
>       |                                               ^~~~~~~~~~~~~
> drivers/infiniband/hw/mlx5/fs.c:3429:1: note: in expansion of macro 'DECLARE_UVERBS_NAMED_OBJECT'
>  3429 | DECLARE_UVERBS_NAMED_OBJECT(MLX5_IB_OBJECT_FLOW_MATCHER,
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> These come from a complex set of macros, and it would be possible to
> shut up the warnings here by adding __maybe_unused annotations inside
> of the macros, it seems cleaner in this case to have a large #ifdef block
> around all the unused parts of the file, in order to still be able to
> catch unused ones elsewhere.

IDK, I'm tempted to revert 36e0d433672f ("RDMA/mlx5: Compile fs.c
regardless of INFINIBAND_USER_ACCESS config")

I don't think that was so well thought out. The entire file was
designed to be USER_ACCESS only because it uses all this mechanism.

#ifdefing away half the file seems ugly.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ