Subject: Re: [PATCH net-next 1/2] bnxt_en: Fix W=1 warning in bnxt_dcb.c from fortify memcpy()

From: "Gustavo A. R. Silva" <[email-masked]>
Date: Tue, 8 Aug 2023 05:16:58 -0600

On Mon, Aug 07, 2023 at 07:57:19AM -0700, Michael Chan wrote:
> Fix the following warning:
> 
> inlined from ‘bnxt_hwrm_queue_cos2bw_qcfg’ at drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c:165:3,
> ./include/linux/fortify-string.h:592:4: error: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror]
>     __read_overflow2_field(q_size_field, size);
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Modify the FW interface defintion of struct hwrm_queue_cos2bw_qcfg_output
> to use an array of sub struct for the queue1 to queue7 fields.  Note that
> the layout of the queue0 fields are different and these are not part of
> the array.  This makes the code much cleaner by removing the pointer
> arithmetic for memcpy().

Thanks for fixing this. :)

> 
> Link: https://lore.kernel.org/netdev/[email-masked]/
> Reviewed-by: Andy Gospodarek <[email-masked]>
> Signed-off-by: Michael Chan <[email-masked]>

Reviewed-by: Gustavo A. R. Silva <[email-masked]>

--
Gustavo