Re: [PATCH] wifi: iwlwifi: pcie: ensure RX_QUEUE_CB_SIZE fits bitfield for gcc-8|9

From: Dan Carpenter
Date: Thu Jun 12 2025 - 09:21:01 EST


On Thu, Jun 12, 2025 at 03:07:19PM +0200, Anders Roxell wrote:
> GCC-8 and GCC-9 emits a hard error when the value passed to
> `u32_encode_bits()`. These versions somehow think that
> RX_QUEUE_CB_SIZE(iwl_trans_get_num_rbds(trans)) is an out of bounds
> constant. Open code this calculation using FIELD_PREP() to avoid this
> compile error.
>
> error: call to '__field_overflow' declared with attribute error: value
> doesn't fit into mask
>
> Fixes: b8eee90f0ba5 ("wifi: iwlwifi: cfg: unify num_rbds config")
> Reported-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/CA+G9fYssasMnOE36xLH5m7ky4fKxbzN7kX5mEE7icnuu+0hGuQ@xxxxxxxxxxxxxx/
> Signed-off-by: Anders Roxell <anders.roxell@xxxxxxxxxx>

Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

regards,
dan carpenter