Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1810191ybz; Sun, 26 Apr 2020 04:49:45 -0700 (PDT) X-Google-Smtp-Source: APiQypIV0cD2AWu5MHfrsMAv/qhAFj8WQYT3R4E1+VbR1hal7V8ZEe73L9XLxMO4D2PbUQQArM0W X-Received: by 2002:a17:907:9481:: with SMTP id dm1mr15638083ejc.9.1587901785402; Sun, 26 Apr 2020 04:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587901785; cv=none; d=google.com; s=arc-20160816; b=G7vAd6bDdrnJq97r3VfHdsU2AA0LblqAiUz+wjMLWTQHQ2ROtyKTxsgnaJZa0XlDLh ZbZemwqjqf0HazI5Ep9rQYP/LPPHBG8gmBFms2me0N3zu4GTtbMaJF8ICX1LUefQ2/PG lLEmwBf68nnF0nyomYKENI22SGuk7ILN/BpCM0xBpc+fo+bc1YM/NAy275kDO7cw+oSD +vzjIZVqKMu30XlKwduCLRQilHq1BzXU0sbv4s8qUwv1c/6XF4c7FYe8CJSmCbbsWfml WFZLSYAqJIc+VNuUgefamlBizQwAX2svqvFfBYaFhGUYR/57pqOEkQYeDINjilEYDXLA mkig== 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=J7P6BpqEyyeFUOeLh/n3py1MIMjRkBmEzmxyAk1D/GM=; b=JnKX8kuj/5lXZTlKFVK7OszSWlZhBbSOibtZB6a+2mG4CXMQx83XkJ/DOLAD774XgS l9w+6kfnK1ylGHtqsm08w4xnNKr0fgplINR1PPKbOOFQDiXVQyFB8GJxUhlDiHvt0ZiR Ds3DbKU+trMU1nNd2Vd2dY5v82fGUb+OKQeUCQO0eDM4+2nkpLvjK43emK5nEhPRh0FU CAG0/mT+WGzo0NGvN5fTqckq8YswUv40uQFVSPfEZ+KJblcZqTzt3mkWUD/Uj5tshWZm JQHdlCGv5VF3+9mUqbaJ/geZKXVTgqKeZ8ZTCYwkZrSKl+uIZqgAT1VVzorfDRHuP5ce x//A== 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 h14si7358764ejd.424.2020.04.26.04.49.22; Sun, 26 Apr 2020 04:49:45 -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 S1726216AbgDZLqu (ORCPT + 99 others); Sun, 26 Apr 2020 07:46:50 -0400 Received: from mga05.intel.com ([192.55.52.43]:11883 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbgDZLqs (ORCPT ); Sun, 26 Apr 2020 07:46:48 -0400 IronPort-SDR: 1kmjzcgEZGhXMZ5240bJFIEsZMmNXrEtpKZ5um1F28UhXnZmTXKN58CFJtorsRriwiCbCVTVUK hBrFxwq2e/gw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2020 04:46:48 -0700 IronPort-SDR: SMOXoiLc6kHuQmCO2n6hhlMkAhxQScaMIpQ9oww2q9IyNt0nF9Tapx7GOZJKMp85xZkqoWzTWD 0fnuec71TfAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,320,1583222400"; d="scan'208";a="275155057" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.193.79]) by orsmga002.jf.intel.com with ESMTP; 26 Apr 2020 04:46:45 -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 V4 2/3] vhost: replace -1 with VHOST_FILE_UNBIND in iotcls Date: Sun, 26 Apr 2020 19:43:25 +0800 Message-Id: <1587901406-27400-3-git-send-email-lingshan.zhu@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1587901406-27400-1-git-send-email-lingshan.zhu@intel.com> References: <1587901406-27400-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 --- 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