From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id C727EC618 for ; Thu, 23 Jun 2016 22:51:22 +0200 (CEST) Received: by mail-pf0-f172.google.com with SMTP id h14so31988907pfe.1 for ; Thu, 23 Jun 2016 13:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XCeT8h2W7U9WeOr6R4KtWOP+FxGRRAT2xoTpQ0STP8U=; b=LhhDt3U+sdWCaFm4oOzvj0bz8Ib5XkrnfnLk/n4FRFZ5gp6wcoDyReHx6/R/CL6fqH ETFNekpr5zc+LMXIvBrKZcJUWKIM19c65M1pc8CzVpmgNsx9FY832aOf9Kqx02rKCEs9 fQLdUPqEx/7rxsLYZYICf07Oh6YyE1fb9R+6xOvK+5ZvRExEh4zq+kfWuJ2QACWOWoZM hlzZKAfbztsczrKJrkJKyNDIDhQxn/ZxiwrQBwO7LjxK/g75uSRvJRWCNiUBAT+Lsn2j oiB1u30krHOJVG0nc5PjpXUKYS80nZm60164/aHVNlE+5B+rrvtSuAryMNjY2pqb/Pvz kbAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XCeT8h2W7U9WeOr6R4KtWOP+FxGRRAT2xoTpQ0STP8U=; b=KnCwEBURhvwgWXb4B5jUszAnPYqQqppV+mG6Al6KIhdMzzYZAaoUlkg6SGChSVHeP7 h2L5gXcJGidXUn1gY6m9sX/OTqvT/2LWbXB/XwihLvYemrnO/r8F8jcSHH1EcSp7wa3w ADxf/pQhcmp0hKQ5L/Uqil3048UEcs7W0EfcuceI9JmpRvLkVMHcpj39mi1Q6alVHu55 lEXi5IquBVP5QgTd9lNI3RPXDLRdeI+fBdsDcoA/sindEtZyfBUM7WqNkR9T4a26yerH V1KU4d2KqAT0OQd4qOZH9zhp3zAepLuqjydKlFpKgzSvxzWWbmxzYBoLPJeMhYpo59by U+iA== X-Gm-Message-State: ALyK8tLiLkxq1MG22mNDAGWtzFOE/8F9WvSb+p2oYorIYVvF0Rzn6RAst2Vry31Nwn4uIw== X-Received: by 10.98.0.83 with SMTP id 80mr739548pfa.0.1466715081957; Thu, 23 Jun 2016 13:51:21 -0700 (PDT) Received: from samsung9 ([199.201.64.134]) by smtp.gmail.com with ESMTPSA id g8sm2136266pag.30.2016.06.23.13.51.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jun 2016 13:51:21 -0700 (PDT) Date: Thu, 23 Jun 2016 13:51:14 -0700 From: Stephen Hemminger To: Jianfeng Tan Cc: dev@dpdk.org, yuanhan.liu@linux.intel.com, huawei.xie@intel.com Message-ID: <20160623135114.2bcfea3d@samsung9> In-Reply-To: <1466667620-67731-1-git-send-email-jianfeng.tan@intel.com> References: <1466667620-67731-1-git-send-email-jianfeng.tan@intel.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/virtio-user: fix implicit int to enum conversion X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 20:51:23 -0000 On Thu, 23 Jun 2016 07:40:20 +0000 Jianfeng Tan wrote: > 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, aka make such conversion explicit. > > Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer") > > Signed-off-by: Jianfeng Tan > --- > drivers/net/virtio/virtio_user/vhost_user.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c > index 95e80f8..e2772d5 100644 > --- a/drivers/net/virtio/virtio_user/vhost_user.c > +++ b/drivers/net/virtio/virtio_user/vhost_user.c > @@ -254,7 +254,7 @@ vhost_user_sock(int vhostfd, uint64_t req, void *arg) > > PMD_DRV_LOG(INFO, "%s", vhost_msg_strings[req]); > > - msg.request = req; > + msg.request = (enum vhost_user_request)req; > msg.flags = VHOST_USER_VERSION; > msg.size = 0; > Why not just just change API, to use enum? This would move type checking out to the user.