From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90B7A100A1 for ; Tue, 8 Aug 2023 11:15:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DAE8C433C7; Tue, 8 Aug 2023 11:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691493356; bh=Y0gDf+zRvLF+bJ9zyS6zyoKtY4CCNUh7ukjcveiZlj4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Iqt7X9EtI+QZTynZGeAJpcYkRI7AetqWS+3y2RJX0WpvZ4u5HQxpfweFVEvN4shpe ejDAQXpd3OnV/s1K15fMGMEXW3M5I1fdzDFDrCOi23bi5UfS5kjaXkYTRhwXP8LuJ9 kJcW0cWVsq+S9feAPmZNP6xqyE2eAvWXJvPnPjILdTH1xIv/THbnxPRce9UUbEqzHI XNKahAjc6GeQRUW/B3b5AzUPurgbX/K4XFhod+F8dBzMKVQQxGFAZJlgB0sZiPTb0B qlQzMvVehGQfRtXrVCw3NYSW0yn9v0odyu2UIiVgDiTyNkFMFa5iPPuqb/eQPsqlzW 9ge7AFyC8vqhA== Date: Tue, 8 Aug 2023 05:16:58 -0600 From: "Gustavo A. R. Silva" To: Michael Chan Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, gustavo@embeddedor.com, Andy Gospodarek Subject: Re: [PATCH net-next 1/2] bnxt_en: Fix W=1 warning in bnxt_dcb.c from fortify memcpy() Message-ID: References: <20230807145720.159645-1-michael.chan@broadcom.com> <20230807145720.159645-2-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230807145720.159645-2-michael.chan@broadcom.com> 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/20230727190726.1859515-2-kuba@kernel.org/ > Reviewed-by: Andy Gospodarek > Signed-off-by: Michael Chan Reviewed-by: Gustavo A. R. Silva -- Gustavo