Subject: Re: [PATCH net-next 2/2] bnxt_en: Fix W=stringop-overflow warning in bnxt_dcb.c

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

On Mon, Aug 07, 2023 at 07:57:20AM -0700, Michael Chan wrote:
> Fix the following warning:
> 
> drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c: In function ‘bnxt_hwrm_queue_cos2bw_cfg’:
> cc1: error: writing 12 bytes into a region of size 1 [-Werror=stringop-overflow ]
> In file included from drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c:19:
> drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h:6045:17: note: destination object ‘unused_0’ of size 1
>  6045 |         u8      unused_0;
> 
> Fix it by modifying struct hwrm_queue_cos2bw_cfg_input to use an array
> of sub struct similar to the previous patch.  This will eliminate the
> pointer arithmetc to calculate the destination pointer passed to
> memcpy().

Thanks for fixing this. :)

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

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

--
Gustavo