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 A376FA0C4B; Mon, 8 Nov 2021 10:20:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6703940DF7; Mon, 8 Nov 2021 10:20:18 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 95EC040040 for ; Mon, 8 Nov 2021 10:20:16 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1A7Nriei002415 for ; Mon, 8 Nov 2021 01:20:15 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=pfpt0220; bh=gKKjTF8Ls7eqJtR5FASwafYYcdOC/YCKf4DQkEDTVd8=; b=DjMAW14OHgE4xaMZisEqZ3Q67612B+31kWqVP1aLsLg/bc8LZHBWxF+BgtzYYMVw2tcg vJwlLvY3tfmMu6F9ypHkK0K54wqq6XKeOlZn3DuvH7t0woKH5rLpXdMICExMfmZqYQuR olTS5nQ4wwrpCBDggMa0TrKQDmcctIv3vL1nnESedizKsn3tCIn6DndsDShRZOi6K5nL MqKQ9wqmKh3aIxtHvyycxMSMoLoJuGGa0MEZN7mm4PLkV66m2jRrERUfJD5+Vb2sBFii d1LOfYY5xXrn2Azy4SE3FYFxnnPdW3AGg24Mj/c95alKOPLI+ueQ6xZzEhELPh1oLE62 hw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3c6j50b3e6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 08 Nov 2021 01:20:15 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 8 Nov 2021 01:20:14 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 8 Nov 2021 01:20:14 -0800 Received: from hyd1349.t110.caveonetworks.com.com (unknown [10.29.45.13]) by maili.marvell.com (Postfix) with ESMTP id E7F3B5B6948; Mon, 8 Nov 2021 01:20:11 -0800 (PST) From: Ankur Dwivedi To: CC: , , , , , , Ankur Dwivedi Date: Mon, 8 Nov 2021 14:49:48 +0530 Message-ID: <20211108091948.9659-1-adwivedi@marvell.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: AYf5AwEauelUtA2DcYE0YEBHh9_Lq50K X-Proofpoint-GUID: AYf5AwEauelUtA2DcYE0YEBHh9_Lq50K X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-08_03,2021-11-03_01,2020-04-07_01 Subject: [dpdk-dev] [PATCH] common/cnxk: fix pointer argument with gcc 12 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The pointer passed to the rq_ctx and sq_ctx functions was the address of qctx. Instead of that qctx should be passed. This patch fixes this. This patch also resolves warning observed with gcc 12 compiler. log: ../drivers/common/cnxk/cnxk_telemetry.h:12:38: warning: array subscript ‘struct nix_cn10k_sq_ctx_s[0]’ is partly outside array bounds of ‘volatile void[8]’ [-Warray-bounds] Bugzilla ID: 853 Fixes: af75aac78978 ("common/cnxk: support telemetry for NIX") Signed-off-by: Ankur Dwivedi Reviewed-by: Gowrishankar Muthukrishnan Reviewed-by: Jerin Jacob Kollanukkaran Tested-by: Jerin Jacob Kollanukkaran --- drivers/common/cnxk/cnxk_telemetry_nix.c | 32 +++++++++++++++--------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/common/cnxk/cnxk_telemetry_nix.c b/drivers/common/cnxk/cnxk_telemetry_nix.c index 1175f68a51..df6458039d 100644 --- a/drivers/common/cnxk/cnxk_telemetry_nix.c +++ b/drivers/common/cnxk/cnxk_telemetry_nix.c @@ -266,9 +266,11 @@ cnxk_tel_nix_sq(struct roc_nix_sq *sq, struct plt_tel_data *d) } static void -nix_rq_ctx_cn9k(void *qctx, struct plt_tel_data *d) +nix_rq_ctx_cn9k(volatile void *qctx, struct plt_tel_data *d) { - struct nix_rq_ctx_s *ctx = (struct nix_rq_ctx_s *)qctx; + volatile struct nix_rq_ctx_s *ctx; + + ctx = (volatile struct nix_rq_ctx_s *)qctx; /* W0 */ CNXK_TEL_DICT_INT(d, ctx, wqe_aura, w0_); @@ -343,9 +345,11 @@ nix_rq_ctx_cn9k(void *qctx, struct plt_tel_data *d) } static void -nix_rq_ctx(void *qctx, struct plt_tel_data *d) +nix_rq_ctx(volatile void *qctx, struct plt_tel_data *d) { - struct nix_cn10k_rq_ctx_s *ctx = (struct nix_cn10k_rq_ctx_s *)qctx; + volatile struct nix_cn10k_rq_ctx_s *ctx; + + ctx = (volatile struct nix_cn10k_rq_ctx_s *)qctx; /* W0 */ CNXK_TEL_DICT_INT(d, ctx, wqe_aura, w0_); @@ -453,9 +457,9 @@ cnxk_tel_nix_rq_ctx(struct roc_nix *roc_nix, uint8_t n, struct plt_tel_data *d) } if (roc_model_is_cn9k()) - nix_rq_ctx_cn9k(&qctx, d); + nix_rq_ctx_cn9k(qctx, d); else - nix_rq_ctx(&qctx, d); + nix_rq_ctx(qctx, d); return 0; } @@ -512,9 +516,11 @@ cnxk_tel_nix_cq_ctx(struct roc_nix *roc_nix, uint8_t n, struct plt_tel_data *d) } static void -nix_sq_ctx_cn9k(void *qctx, struct plt_tel_data *d) +nix_sq_ctx_cn9k(volatile void *qctx, struct plt_tel_data *d) { - struct nix_sq_ctx_s *ctx = (struct nix_sq_ctx_s *)qctx; + volatile struct nix_sq_ctx_s *ctx; + + ctx = (volatile struct nix_sq_ctx_s *)qctx; /* W0 */ CNXK_TEL_DICT_INT(d, ctx, sqe_way_mask, w0_); @@ -595,9 +601,11 @@ nix_sq_ctx_cn9k(void *qctx, struct plt_tel_data *d) } static void -nix_sq_ctx(void *qctx, struct plt_tel_data *d) +nix_sq_ctx(volatile void *qctx, struct plt_tel_data *d) { - struct nix_cn10k_sq_ctx_s *ctx = (struct nix_cn10k_sq_ctx_s *)qctx; + volatile struct nix_cn10k_sq_ctx_s *ctx; + + ctx = (volatile struct nix_cn10k_sq_ctx_s *)qctx; /* W0 */ CNXK_TEL_DICT_INT(d, ctx, sqe_way_mask, w0_); @@ -698,9 +706,9 @@ cnxk_tel_nix_sq_ctx(struct roc_nix *roc_nix, uint8_t n, struct plt_tel_data *d) } if (roc_model_is_cn9k()) - nix_sq_ctx_cn9k(&qctx, d); + nix_sq_ctx_cn9k(qctx, d); else - nix_sq_ctx(&qctx, d); + nix_sq_ctx(qctx, d); return 0; } -- 2.28.0