From nobody Sun Feb 8 19:59:49 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582204041; cv=none; d=zohomail.com; s=zohoarc; b=kNE9+jb2FM5/2pF2HcUCXePCYsEdl6WC8d09ay9EXIsoPmG3GgozcekidSgA9of7LwuRsJTB0QrQYKC44ftRcYSXX7oy6xaKWPN/ksMkmjwmuv4bWQiV8kRBoUpGbkfmlPF/H/Ci3SBDJwRSdYQAa/ASHILspDJsp3uujjU473I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582204041; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=06epLb7SG9zSXmaib4XTGaeG6HWz95FsgoY4EHvDtVs=; b=mUvuEPUO/qkSI9fKLeN7QGPDDyBhpIVZ6NGM+0eFjCPZ8iAAsgiSwK2ZZIXzMRrkLN9+3OG8Fscr9LYM+JtAGhQFWZLEFk3ioOynWYIoFsaU/4EGd346Gp8OaI5YYDU3RYqhO4QoNp7DWiNSoyHx5FSQjkmpF1nivhADvKMpG/U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1582204041170870.8873366107501; Thu, 20 Feb 2020 05:07:21 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lXX-0001aj-8E; Thu, 20 Feb 2020 13:06:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lXW-0001ZT-5d for xen-devel@lists.xenproject.org; Thu, 20 Feb 2020 13:06:50 +0000 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.81]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id db1ac79e-53e1-11ea-b0fd-bc764e2007e4; Thu, 20 Feb 2020 13:06:49 +0000 (UTC) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-435-ljcDfudVN3mTAOk7tZceeg-1; Thu, 20 Feb 2020 08:06:47 -0500 Received: by mail-wm1-f69.google.com with SMTP id p2so580217wma.3 for ; Thu, 20 Feb 2020 05:06:47 -0800 (PST) Received: from localhost.localdomain (78.red-88-21-202.staticip.rima-tde.net. [88.21.202.78]) by smtp.gmail.com with ESMTPSA id b67sm4594690wmc.38.2020.02.20.05.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 05:06:45 -0800 (PST) X-Inumbo-ID: db1ac79e-53e1-11ea-b0fd-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582204009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gva/oijUn2ukqqFeWUu5GYV/ONiMfg1SXT6HuIycNbc=; b=UFxz7BX+2umSakbE+V9Ui5ztFgkY+WJwhuHIITfNo1SyYv3rQHkHdFOZQuTmX/qEEypnW2 UuNCmL34KoJn8cxIENChsEeJcb6Ke4zLrMIdsKt+PfjG63/6tVLYf2e813kbVo9whmBaOj TUGR0NNyxN4G+bYLi8tb0yigZZCgcEw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=epBBiJe/BiipnhOxinjfU345ql1651dsm1KJ2Eg1l+8=; b=EWZkARrjNDPSXjpIU1UCH/AV7VbuOnHUaRrQUgKI5/1sSNDlD6CiHrnjYyJrQ2OC60 zkhz6/2wjbGdyfPS5OFN+o6wkJ8pUI/IQ2q5GLQNNzJlocSWgN5bMi3oVDYmCFXbuIRy njW9fHibWp9hcsnL7nADyi29q1cZwXTdUs7x7UmqsLOTrFZ/0/xdVXgzeQRZIxQ6tNHR Ox9UsCSiCmgyZkrZjU5nYMb7g08Nj/XyNA4wCzT8V2urKGPaVzIJBoyPS844dnQ9fzrV Wi89+gEL1snh9WR9Ab52nrHZv66fqL+1EsSZXoc5dYb6c733+aRKipFK+Hlq6QTeEoeG dLOw== X-Gm-Message-State: APjAAAX3aOUZ1kvcgUkw4rIeqjHAn251vdXFZaYgfFIkBD+i+z+g5HFK KFwU/sMs+OUJysGNoFj8TED+oiGGG6V2DPYJQ0CkXNMk5kAf2IWlFeqArz96Z39H9M7+JVXxgAP U033W7QaAA572nPWhvvBn5chWcIM= X-Received: by 2002:a05:600c:295d:: with SMTP id n29mr4504820wmd.101.1582204006820; Thu, 20 Feb 2020 05:06:46 -0800 (PST) X-Google-Smtp-Source: APXvYqyzyX5Y7gdzaTOQjQ/rcWnepNEp6tk5YfOUODjdV1i7lhwV6s1r0NC2sbtsj+sn6/vQEc+xMg== X-Received: by 2002:a05:600c:295d:: with SMTP id n29mr4504765wmd.101.1582204006470; Thu, 20 Feb 2020 05:06:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 20 Feb 2020 14:05:42 +0100 Message-Id: <20200220130548.29974-15-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200220130548.29974-1-philmd@redhat.com> References: <20200220130548.29974-1-philmd@redhat.com> MIME-Version: 1.0 X-MC-Unique: ljcDfudVN3mTAOk7tZceeg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [Xen-devel] [PATCH v3 14/20] hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Dmitry Fleytman , kvm@vger.kernel.org, "Michael S. Tsirkin" , Jason Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Stefano Stabellini , Matthew Rosato , qemu-block@nongnu.org, David Hildenbrand , Halil Pasic , Christian Borntraeger , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , Anthony Perard , xen-devel@lists.xenproject.org, Aleksandar Rikalo , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth , Eduardo Habkost , Stefan Weil , Alistair Francis , Richard Henderson , Paul Durrant , Eric Auger , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , John Snow , David Gibson , Igor Mitsyanko , Cornelia Huck , Michael Walle , qemu-ppc@nongnu.org, Paolo Bonzini Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The 'is_write' argument is either 0 or 1. Convert it to a boolean type. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/vhost.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 9edfadc81d..0d226dae10 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -294,7 +294,7 @@ static int vhost_dev_has_iommu(struct vhost_dev *dev) } =20 static void *vhost_memory_map(struct vhost_dev *dev, hwaddr addr, - hwaddr *plen, int is_write) + hwaddr *plen, bool is_write) { if (!vhost_dev_has_iommu(dev)) { return cpu_physical_memory_map(addr, plen, is_write); @@ -1012,21 +1012,21 @@ static int vhost_virtqueue_start(struct vhost_dev *= dev, =20 vq->desc_size =3D s =3D l =3D virtio_queue_get_desc_size(vdev, idx); vq->desc_phys =3D a; - vq->desc =3D vhost_memory_map(dev, a, &l, 0); + vq->desc =3D vhost_memory_map(dev, a, &l, false); if (!vq->desc || l !=3D s) { r =3D -ENOMEM; goto fail_alloc_desc; } vq->avail_size =3D s =3D l =3D virtio_queue_get_avail_size(vdev, idx); vq->avail_phys =3D a =3D virtio_queue_get_avail_addr(vdev, idx); - vq->avail =3D vhost_memory_map(dev, a, &l, 0); + vq->avail =3D vhost_memory_map(dev, a, &l, false); if (!vq->avail || l !=3D s) { r =3D -ENOMEM; goto fail_alloc_avail; } vq->used_size =3D s =3D l =3D virtio_queue_get_used_size(vdev, idx); vq->used_phys =3D a =3D virtio_queue_get_used_addr(vdev, idx); - vq->used =3D vhost_memory_map(dev, a, &l, 1); + vq->used =3D vhost_memory_map(dev, a, &l, true); if (!vq->used || l !=3D s) { r =3D -ENOMEM; goto fail_alloc_used; --=20 2.21.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel