Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 438B8C11D04 for ; Thu, 20 Feb 2020 13:06:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AAAF206ED for ; Thu, 20 Feb 2020 13:06:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ciev9NRZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728211AbgBTNGr (ORCPT ); Thu, 20 Feb 2020 08:06:47 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:26620 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727285AbgBTNGq (ORCPT ); Thu, 20 Feb 2020 08:06:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582204005; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UKC5US0FVl1pIv+lPWy76t1kr1KKdCp1Se8AoBMs7qQ=; b=Ciev9NRZ14iDP9dkl3L/g/nmjOnPTyzO5Rmby1k+T8oz9Kvpqxl5v464/vlwKvQMIBGPU6 qDWgo/4dKz/vt1pIbjE/dNZAfs27egjjrP80oQyu/ppz25e2/dpfjjyeW0389Bn3NRkeIK +NMiGOwRX93NKZ1CT3Edv1Fhh1jpabw= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-154-ChMjaRT9MXyUUwWYOGi8Sg-1; Thu, 20 Feb 2020 08:06:44 -0500 X-MC-Unique: ChMjaRT9MXyUUwWYOGi8Sg-1 Received: by mail-wr1-f71.google.com with SMTP id s13so1701531wrb.21 for ; Thu, 20 Feb 2020 05:06:43 -0800 (PST) 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=UKC5US0FVl1pIv+lPWy76t1kr1KKdCp1Se8AoBMs7qQ=; b=DbK2kSYm6avx7ULpN0hAOdGjgHyS6lcRH7777Zsrf/JU0gWPhbwOCoIeMcrSH+vND2 sIpG56Hp7Iwz4a3DhTEaFe1A1SOJ7Uk/t9Nrn6IJPtca7RnYkpirl8ythe87dA7dzu0Y aqVi0AUEfbI2FoZggvdStPqXxJfpMPxICWGENO+hxclMli549NCPnTyooGUSSPdT9Pja urPI+G6GwqRKOADkksxxmVv7nX7yNXsPnjbSJllFVnswt8ZPpTOs3OfpxrFSPaTweggr r6lYOvbprf3Xhn5/FihpuvtRpXAv6wJC8tJVORt5wQxI8h9HeD/SNEp2Y6nn3OTUwIKn pT4w== X-Gm-Message-State: APjAAAXuqYe+BNLVlaCLxXGUzFhYKInqwTI92tSY0dsuNJ52rlTLZ72t IMWVCp8CE6wyZzCs/YMpDsCj8wTYvhd9ol6puipMItes4yg1ue3wLNitEIbMwN6kJNhnQCUL+kF fV9F/pe656MXb X-Received: by 2002:a5d:4c84:: with SMTP id z4mr43731108wrs.423.1582204002760; Thu, 20 Feb 2020 05:06:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwqHc8xSBLutdUhIzf/cdvh5+i6wOt8LjaLS6C9c63Yasey84Mhi4F8A6DvfBLGaafXEkCiSQ== X-Received: by 2002:a5d:4c84:: with SMTP id z4mr43731080wrs.423.1582204002528; Thu, 20 Feb 2020 05:06:42 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 05:06:41 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Anthony Perard , Fam Zheng , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Laurent Vivier , Thomas Huth , Stefan Weil , Eric Auger , Halil Pasic , Marcel Apfelbaum , qemu-s390x@nongnu.org, Aleksandar Rikalo , David Gibson , Michael Walle , qemu-ppc@nongnu.org, Gerd Hoffmann , Cornelia Huck , qemu-arm@nongnu.org, Alistair Francis , qemu-block@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Jason Wang , xen-devel@lists.xenproject.org, Christian Borntraeger , Dmitry Fleytman , Matthew Rosato , Eduardo Habkost , Richard Henderson , "Michael S. Tsirkin" , David Hildenbrand , Paolo Bonzini , Stefano Stabellini , Igor Mitsyanko , Paul Durrant , Richard Henderson , John Snow Subject: [PATCH v3 13/20] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument Date: Thu, 20 Feb 2020 14:05:41 +0100 Message-Id: <20200220130548.29974-14-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 Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The 'is_write' argument is either 0 or 1. Convert it to a boolean type. Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 2c5410e981..9d06dbe3ef 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1293,7 +1293,7 @@ static void virtqueue_undo_map_desc(unsigned int out_num, unsigned int in_num, static void virtqueue_map_iovec(VirtIODevice *vdev, struct iovec *sg, hwaddr *addr, unsigned int num_sg, - int is_write) + bool is_write) { unsigned int i; hwaddr len; @@ -1317,8 +1317,9 @@ static void virtqueue_map_iovec(VirtIODevice *vdev, struct iovec *sg, void virtqueue_map(VirtIODevice *vdev, VirtQueueElement *elem) { - virtqueue_map_iovec(vdev, elem->in_sg, elem->in_addr, elem->in_num, 1); - virtqueue_map_iovec(vdev, elem->out_sg, elem->out_addr, elem->out_num, 0); + virtqueue_map_iovec(vdev, elem->in_sg, elem->in_addr, elem->in_num, true); + virtqueue_map_iovec(vdev, elem->out_sg, elem->out_addr, elem->out_num, + false); } static void *virtqueue_alloc_element(size_t sz, unsigned out_num, unsigned in_num) -- 2.21.1