DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jianfeng Tan <jianfeng.tan@intel.com>
To: dev@dpdk.org
Cc: yuanhan.liu@linux.intel.com, huawei.xie@intel.com,
	stephen@networkplumber.org, Jianfeng Tan <jianfeng.tan@intel.com>
Subject: [dpdk-dev] [PATCH v2] net/virtio-user: fix implicit int to enum conversion
Date: Sun, 26 Jun 2016 13:48:13 +0000	[thread overview]
Message-ID: <1466948893-11887-1-git-send-email-jianfeng.tan@intel.com> (raw)
In-Reply-To: <1466667620-67731-1-git-send-email-jianfeng.tan@intel.com>

Implicit int to enum conversion is not allowed when icc is used as
the compiler. It raises the compiling error like,
    /.../dpdk/drivers/net/virtio/virtio_user/vhost_user.c(257):
        error #188: enumerated type mixed with another type
  	msg.request = req;
  	            ^

The fix is simple, change the type of parameter req to enum
vhost_user_request.

Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")

Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
 drivers/net/virtio/virtio_user/vhost.h      | 2 +-
 drivers/net/virtio/virtio_user/vhost_user.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h
index 897042f..7adb55f 100644
--- a/drivers/net/virtio/virtio_user/vhost.h
+++ b/drivers/net/virtio/virtio_user/vhost.h
@@ -139,7 +139,7 @@ struct vhost_user_msg {
 #define VHOST_USER_F_PROTOCOL_FEATURES 30
 #define VHOST_USER_MQ (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)
 
-int vhost_user_sock(int vhostfd, uint64_t req, void *arg);
+int vhost_user_sock(int vhostfd, enum vhost_user_request req, void *arg);
 int vhost_user_setup(const char *path);
 int vhost_user_enable_queue_pair(int vhostfd, uint16_t pair_idx, int enable);
 
diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index 95e80f8..a2b0687 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -240,7 +240,7 @@ static const char * const vhost_msg_strings[] = {
 };
 
 int
-vhost_user_sock(int vhostfd, uint64_t req, void *arg)
+vhost_user_sock(int vhostfd, enum vhost_user_request req, void *arg)
 {
 	struct vhost_user_msg msg;
 	struct vhost_vring_file *file = 0;
-- 
2.1.4

  parent reply	other threads:[~2016-06-26 13:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23  7:40 [dpdk-dev] [PATCH] " Jianfeng Tan
2016-06-23 20:51 ` Stephen Hemminger
2016-06-24  0:51   ` Tan, Jianfeng
2016-06-26 13:48 ` Jianfeng Tan [this message]
2016-06-30  5:28   ` [dpdk-dev] [PATCH v2] " Yuanhan Liu

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=1466948893-11887-1-git-send-email-jianfeng.tan@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=yuanhan.liu@linux.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).