From: Jason Gunthorpe <jgg@ziepe.ca>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Leon Romanovsky <leon@kernel.org>,
Patrisious Haddad <phaddad@nvidia.com>,
Arnd Bergmann <arnd@arndb.de>, Mark Bloch <mbloch@nvidia.com>,
Tariq Toukan <tariqt@nvidia.com>,
Jakub Kicinski <kuba@kernel.org>,
Moshe Shemesh <moshe@nvidia.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/mlx5: hide unused code
Date: Fri, 28 Mar 2025 10:15:13 -0300 [thread overview]
Message-ID: <20250328131513.GB20836@ziepe.ca> (raw)
In-Reply-To: <20250328131022.452068-1-arnd@kernel.org>
On Fri, Mar 28, 2025 at 02:10:17PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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
next prev parent reply other threads:[~2025-03-28 13:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-28 13:10 [PATCH] RDMA/mlx5: hide unused code Arnd Bergmann
2025-03-28 13:15 ` Jason Gunthorpe [this message]
2025-03-28 13:20 ` Arnd Bergmann
2025-03-31 9:30 ` Mark Bloch
2025-04-01 15:20 ` Patrisious Haddad
2025-04-01 15:36 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250328131513.GB20836@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=moshe@nvidia.com \
--cc=phaddad@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox