Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2019213ybg; Fri, 5 Jun 2020 03:33:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0cuslvFuIgmXlY0Le4jyECN1R69l9BeBHbl5GuMIy6xllMbcbJZyXiXOXXFZIpj+XTXsV X-Received: by 2002:aa7:d5c7:: with SMTP id d7mr8738311eds.11.1591353214583; Fri, 05 Jun 2020 03:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591353214; cv=none; d=google.com; s=arc-20160816; b=aOoCmBYnIAzR9y/yiuOpeoucmZKdOW2ZYUdR6IK1XzFuTklYfMz28ctpXHW0OyedUt tEM3dd1oZN0LJr0R08YkR2ynURm1WMEmBCCQBFoDQ58hkAtJpBu3fWpa3l+zVhb34oc2 H7hWiGxTEpnjLKaihup4Jo4oIkYsWCCLNghaVJFGPXvCYHVD3PxP4SctbjaApv/6GhxI Bn5uImKG1Xg4vXRMmcpOW/Cq6WCbgPGEEZFJLlM/13vbHXI2zUGI783mjzMuGxNQI7SX quSLVCrltT9BxJkr+XSs0/BFKm2E6Oy6oWrHlfmSfh/MwRC+E1x4ZS9gaQV1JpMCX3ik pE0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=yJOaRJY2bOFdwlpHYc1r8tbWmDp5ynYW5naB0U2Cyaw=; b=mMOSnmnjicwCtOd0DKyam5QTzF3Q+VTYsTF9WJ0uzfYFbPZzX2Ajisw37V2UIzD37G W3rE7WKVrGqpUM2YgWgu2WCYbLdAaCI1fWhfGH9FAfIVet1N5O10c4fZH8bDZJH6lerz 2gpLEAWXzz7iEw47LsSajEnl1VFyZ34NkPn3ED0o9g/QPhce516KEfK6e6NbeFDUmLG9 Kw1Gzvg3vF5+awd1nIKBt4Ah8SwdNguDtuPX4LnKiEIit72blvD1aCimU8wTVTY9Hid5 iFl7d00WbOE+/YuuuHwXWHRmKG/dVyhVb9pH7uWCBwgMuGCxzsKajvJ5XXw5SEPQFWDT PbVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr12si4239420ejc.352.2020.06.05.03.33.11; Fri, 05 Jun 2020 03:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726746AbgFEKbR (ORCPT + 99 others); Fri, 5 Jun 2020 06:31:17 -0400 Received: from mga18.intel.com ([134.134.136.126]:57119 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbgFEKbM (ORCPT ); Fri, 5 Jun 2020 06:31:12 -0400 IronPort-SDR: GOo6mgn05Ut+Haxu37fik7KTadMMY2T1Z2JD5hVuwEUf/SZZHAF/HqST5rlibgOIM6pXU64NOB Bu3eM3avf4MA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2020 03:31:11 -0700 IronPort-SDR: lm3QYIaVxLSkhqT0pKn9HJj5bMORhCda7mMWueJwGR/cyePta+VX6cPyygJaWvENQdjCfjz3K5 oRUn1U51sg+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,476,1583222400"; d="scan'208";a="305024954" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.192.131]) by fmsmga002.fm.intel.com with ESMTP; 05 Jun 2020 03:31:09 -0700 From: Zhu Lingshan To: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, jasowang@redhat.com Cc: lulu@redhat.com, dan.daly@intel.com, cunming.liang@intel.com, Zhu Lingshan Subject: [PATCH RESEND 4/5] vhost: replace -1 with VHOST_FILE_UNBIND in iotcls Date: Fri, 5 Jun 2020 18:27:14 +0800 Message-Id: <1591352835-22441-5-git-send-email-lingshan.zhu@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1591352835-22441-1-git-send-email-lingshan.zhu@intel.com> References: <1591352835-22441-1-git-send-email-lingshan.zhu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit replaces -1 with VHOST_FILE_UNBIND in ioctls since we have added such a macro in the uapi header for vdpa_host. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vhost/vhost.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index d450e16..8ba3ed2 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1574,7 +1574,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg r = -EFAULT; break; } - eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); + eventfp = f.fd == VHOST_FILE_UNBIND ? NULL : eventfd_fget(f.fd); if (IS_ERR(eventfp)) { r = PTR_ERR(eventfp); break; @@ -1590,7 +1590,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg r = -EFAULT; break; } - ctx = f.fd == -1 ? NULL : eventfd_ctx_fdget(f.fd); + ctx = f.fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(f.fd); if (IS_ERR(ctx)) { r = PTR_ERR(ctx); break; @@ -1602,7 +1602,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg r = -EFAULT; break; } - ctx = f.fd == -1 ? NULL : eventfd_ctx_fdget(f.fd); + ctx = f.fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(f.fd); if (IS_ERR(ctx)) { r = PTR_ERR(ctx); break; @@ -1727,7 +1727,7 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp) r = get_user(fd, (int __user *)argp); if (r < 0) break; - ctx = fd == -1 ? NULL : eventfd_ctx_fdget(fd); + ctx = fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(fd); if (IS_ERR(ctx)) { r = PTR_ERR(ctx); break; -- 1.8.3.1