DPDK patches and discussions
 help / color / mirror / Atom feed
From: beilei.xing@intel.com
To: jingjing.wu@intel.com
Cc: dev@dpdk.org, Beilei Xing <beilei.xing@intel.com>
Subject: [PATCH] net/idpf: fix compiling error in CentOS 7
Date: Tue,  1 Nov 2022 01:54:44 +0000	[thread overview]
Message-ID: <20221101015444.102627-1-beilei.xing@intel.com> (raw)

From: Beilei Xing <beilei.xing@intel.com>

There's build error with clang 3.4.2 in CentOS 7:

drivers/net/idpf/idpf_vchnl.c:141:13: error: comparison of constant
522 with expression of type 'enum virtchnl_ops' is always false
[-Werror,-Wtautological-constant-out-of-range-compare]

Fixed the compiling error in the patch.

Fixes: 549343c25db8 ("net/idpf: support device initialization")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/idpf/idpf_vchnl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/idpf/idpf_vchnl.c b/drivers/net/idpf/idpf_vchnl.c
index 00ac5b2a6b..ac6486d4ef 100644
--- a/drivers/net/idpf/idpf_vchnl.c
+++ b/drivers/net/idpf/idpf_vchnl.c
@@ -55,7 +55,7 @@ idpf_vc_clean(struct idpf_adapter *adapter)
 }
 
 static int
-idpf_send_vc_msg(struct idpf_adapter *adapter, enum virtchnl_ops op,
+idpf_send_vc_msg(struct idpf_adapter *adapter, uint32_t op,
 		 uint16_t msg_size, uint8_t *msg)
 {
 	struct idpf_ctlq_msg *ctlq_msg;
@@ -118,7 +118,7 @@ idpf_read_msg_from_cp(struct idpf_adapter *adapter, uint16_t buf_len,
 	struct idpf_ctlq_msg ctlq_msg;
 	struct idpf_dma_mem *dma_mem = NULL;
 	enum idpf_vc_result result = IDPF_MSG_NON;
-	enum virtchnl_ops opcode;
+	uint32_t opcode;
 	uint16_t pending = 1;
 	int ret;
 
@@ -132,7 +132,7 @@ idpf_read_msg_from_cp(struct idpf_adapter *adapter, uint16_t buf_len,
 
 	rte_memcpy(buf, ctlq_msg.ctx.indirect.payload->va, buf_len);
 
-	opcode = (enum virtchnl_ops)rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_opcode);
+	opcode = rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_opcode);
 	adapter->cmd_retval =
 		(enum virtchnl_status_code)rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_retval);
 
-- 
2.26.2


             reply	other threads:[~2022-11-01  2:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01  1:54 beilei.xing [this message]
2022-11-01  2:43 ` [PATCH v2] " beilei.xing
2022-11-01  7:38   ` Ali Alnubani
2022-11-02 12:48     ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221101015444.102627-1-beilei.xing@intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).