From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F80EA00C2 for ; Thu, 16 Jun 2022 12:34:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97F1642B6C; Thu, 16 Jun 2022 12:34:55 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id A4E944003C; Thu, 16 Jun 2022 12:34:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655375692; x=1686911692; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Re8Tm6YbI5nXLsrla/pZ93GyuHZI2bCY2W+rLYvm0WI=; b=PYK8tPX2N71OyadevnQpkC+KRQUzzXOj9tN1x192fMtkY1/fodj1UXGc aCeEkQL2RBRLbuxjrhgeWiawWGhJjZv4vmN7woA95lo4nN9dxryIerN3D M68gZY+11w1VhQ0hnJUit81KimbCLjf5vCIHUgpe7BFcRVgnxoOBPybeQ /pbiN1/WN0KWJ9Ty6CuGOAvXPHYB1NXPbY4ik6Z+SKVPhyetzQBt7XH+d /TdjQVKzkfiq0qegOGr+csifyVrshkX5CNpQ9Nv40d2i9hCYJLH5YMma1 qlmyWUiiiJg6vW+rn8rOVGWDopk5ML2dU0sBQbzWlTd7+2r+j5ToTppPV Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="340874269" X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="340874269" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 03:34:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="641483309" Received: from unknown (HELO localhost.localdomain) ([10.239.252.3]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 03:34:49 -0700 From: wenxuanx.wu@intel.com To: qiming.yang@intel.com, qi.z.zhang@intel.com, dev@dpdk.org, thomas@monjalon.net Cc: stephen@networkplumber.org, wenxuanx.wu@intel.com, stable@dpdk.org Subject: [PATCH] ice/base: fix gcc 12 warning stringop-overflow Date: Thu, 16 Jun 2022 18:33:04 +0800 Message-Id: <20220616103304.132368-1-wenxuanx.wu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Wenxuan Wu Gcc with -O2 flag, would retrieve the value in one time. This patch changed the type of fv_idx in struct ice_recp_grp_entry to align with its callers which is also u8 type. When u8 idx[5] = a value u16 index[4], gcc12 would give this warning, because it is not big enough to store the bytes(bigger than 5 bytes) in one time (-O2 would do it in this way). Fixes: 04b8ec1ea807 ("net/ice/base: add protocol structures and defines") Cc: stable@dpdk.org Signed-off-by: Wenxuan Wu --- drivers/net/ice/base/ice_protocol_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h index 0e6e5990be..cfe3b62630 100644 --- a/drivers/net/ice/base/ice_protocol_type.h +++ b/drivers/net/ice/base/ice_protocol_type.h @@ -421,7 +421,7 @@ struct ice_recp_grp_entry { #define ICE_INVAL_CHAIN_IND 0xFF u16 rid; u8 chain_idx; - u16 fv_idx[ICE_NUM_WORDS_RECIPE]; + u8 fv_idx[ICE_NUM_WORDS_RECIPE]; u16 fv_mask[ICE_NUM_WORDS_RECIPE]; struct ice_pref_recipe_group r_group; }; -- 2.25.1