patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] ice/base: fix gcc 12 warning stringop-overflow
@ 2022-06-16 10:33 wenxuanx.wu
  2022-06-16 14:29 ` David Marchand
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: wenxuanx.wu @ 2022-06-16 10:33 UTC (permalink / raw)
  To: qiming.yang, qi.z.zhang, dev, thomas; +Cc: stephen, wenxuanx.wu, stable

From: Wenxuan Wu <wenxuanx.wu@intel.com>

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 <wenxuanx.wu@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-06-23  9:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 10:33 [PATCH] ice/base: fix gcc 12 warning stringop-overflow wenxuanx.wu
2022-06-16 14:29 ` David Marchand
2022-06-17  1:29   ` Wu, WenxuanX
2022-06-17  5:04     ` David Marchand
2022-06-19 12:34 ` Zhang, Qi Z
2022-06-20  1:38   ` Wu, WenxuanX
2022-06-20  5:06     ` Wu, WenxuanX
2022-06-23  7:42       ` David Marchand
2022-06-23  9:01 ` [PATCH v2] net/ice/base: " wenxuanx.wu
2022-06-23  9:21   ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).