[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <69815658-68cd-46cf-bca1-81119bbdb49a@embeddedor.com>
Date: Thu, 27 Feb 2025 12:06:03 +1030
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Saeed Mahameed <saeed@...nel.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Saeed Mahameed <saeedm@...dia.com>, Leon Romanovsky <leon@...nel.org>,
Tariq Toukan <tariqt@...dia.com>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v3][next] net/mlx5e: Avoid a hundred
-Wflex-array-member-not-at-end warnings
>>
>> -struct mlx5e_umr_wqe {
>> +struct mlx5e_umr_wqe_hdr {
>> struct mlx5_wqe_ctrl_seg ctrl;
>> struct mlx5_wqe_umr_ctrl_seg uctrl;
>> struct mlx5_mkey_seg mkc;
>> +};
>> +
>> +struct mlx5e_umr_wqe {
>> + struct mlx5e_umr_wqe_hdr hdr;
>
> You missed or ignored my comment on v0, anyway:
>
> Can we have struct mlx5e_umr_wq_hdr defined anonymously within
> mlx5e_umr_wqe? Let's avoid namespace pollution.
I thought your comment was directed to Jabuk.
I don't see how to avoid that and at the same time changing
the type of the conflicting object and fix the warnings:
- struct mlx5e_umr_wqe umr_wqe;
+ struct mlx5e_umr_wqe_hdr umr_wqe;
My first patch avoids the need to introduce a bunch of `hdr.`
changes. However, `hdr` is introduced as an identifier for
the members grouped in the new type `struct mlx5e_umr_wqe_hdr`.
Of course struct_group_tagged() also creates an anonymous struct,
which is why we can avoid all those `hdr.` changes in v1.
--
Gustavo
Powered by blists - more mailing lists