Re: [PATCH net-next 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags

Bartosz Golaszewski
2023-06-22T07:07:30Z

On Wed, Jun 21, 2023 at 10:12 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 21 Jun 2023 20:25:46 +0200 Bartosz Golaszewski wrote:
> > As suggested by Jose Abreu: let's drop all 12 boolean fields in
> > plat_stmmacenet_data and replace them with a common bitfield.
>
> Is that what Jose meant, or:
>
> - bool has_integrated_pcs;
> + u32 has_integrated_pcs:1;
>
> ?

For that to work all fields would need to be gathered together (unless
the structure is __packed - not a good idea) and all future fields
would need to be added in a specific place in the structure definition
as well. I think a bit field is clearer and harder to get wrong here.

Bart