From patchwork Thu Feb 20 13:05:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11394103 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2964C17E0 for ; Thu, 20 Feb 2020 13:07:39 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 06372206ED for ; Thu, 20 Feb 2020 13:07:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VvTkBGI9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06372206ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lXQ-0001T1-AM; Thu, 20 Feb 2020 13:06:44 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lXO-0001RZ-Ta for xen-devel@lists.xenproject.org; Thu, 20 Feb 2020 13:06:42 +0000 X-Inumbo-ID: d6be2ca4-53e1-11ea-bc8e-bc764e2007e4 Received: from us-smtp-1.mimecast.com (unknown [205.139.110.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id d6be2ca4-53e1-11ea-bc8e-bc764e2007e4; Thu, 20 Feb 2020 13:06:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582204002; 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=+QWKOueI8xj2IyxqHiN0HDA2FYFFiq+hf4rVm2QXvB4=; b=VvTkBGI9MFwt+yQNtKJ+kXhLb06Wmk5A+xl98vSTZkqz88z39Df9I+fIPXpJpxkxrv/Uqt dOY58/uHbJH3sLLcZ6htSd2zUwoKu3YlDdzMlaHFBNQDOZBwQ1keHQE8orTh/XSmqdDyKM mpSaUytEm+gmsO0JXd7bbyL4xLVBhW8= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-116-x-FizCD8PyqLhXnHx2PpIA-1; Thu, 20 Feb 2020 08:06:40 -0500 X-MC-Unique: x-FizCD8PyqLhXnHx2PpIA-1 Received: by mail-wr1-f70.google.com with SMTP id p8so1714031wrw.5 for ; Thu, 20 Feb 2020 05:06:40 -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=afmBLGH/B/Ms0UWZ94UmoIT7hbpf9let5QJOgK6MO7U=; b=SMGsdSrrFXXvpy7QVdfCUpk4RGowSdVsajFzaFNeRGVH9m7/TtFbfnHoljhcO2Huao dtrblDC/HTbJ8n/zuZmGCutdDNPk/az94BK11JW4p56Yj77AGOuMu8caha9vdWzrWg3O vZ2WHwhDDhhnWr6qo6jM5/YJxYV1fKbS56fpcz9n4CKAELQZ2iCJxx3glRGGl2yM1ifN 0h0DgFkldQbsNfQVLLJM859eeUNRJxO1kuo5eSb1QKovD+owYX5uybuuAf/mbUo4Hcfb tEMyqLkOiMxR7NuxbnF7sUvd8lkjQwDZNqk3GGSjx87HCPuypa2PSUZImE9eULgJIPD0 JmOg== X-Gm-Message-State: APjAAAXCs9gZpNha/4pB8lEncSei96a7cswJJnTD9Wxr2Abri/gUdPu3 WT3I791mJ7ObFSzKYIaEEgdRVSQ2pVbIuQQ9QgC8DpON7xYEyZJf4qFEsva9J5qKGL6U8wNDOfR 9yUemosA1QDY0e4f4UJKNXs6L304= X-Received: by 2002:adf:82ce:: with SMTP id 72mr42311844wrc.14.1582203999001; Thu, 20 Feb 2020 05:06:39 -0800 (PST) X-Google-Smtp-Source: APXvYqw/3uQMphtI1ikMZVT/CqYmBN8hXBmJPGI/dMUcHwpK44vfqMtR6BuBqN22Zj6SP9un5Qj48Q== X-Received: by 2002:adf:82ce:: with SMTP id 72mr42311818wrc.14.1582203998804; Thu, 20 Feb 2020 05:06:38 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 05:06:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 20 Feb 2020 14:05:40 +0100 Message-Id: <20200220130548.29974-13-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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [Xen-devel] [PATCH v3 12/20] hw/ide: Let the DMAIntFunc prototype 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_Poussi?= =?utf-8?q?neau?= , Marcel Apfelbaum , Anthony Perard , xen-devel@lists.xenproject.org, Aleksandar Rikalo , Richard Henderson , =?utf-8?q?Philippe_Mathieu-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_Le_Goater?= , John Snow , David Gibson , Igor Mitsyanko , Cornelia Huck , Michael Walle , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The 'is_write' argument is either 0 or 1. Convert it to a boolean type. Signed-off-by: Philippe Mathieu-Daudé Acked-by: John Snow --- include/hw/ide/internal.h | 2 +- hw/dma/rc4030.c | 6 +++--- hw/ide/ahci.c | 2 +- hw/ide/core.c | 2 +- hw/ide/macio.c | 2 +- hw/ide/pci.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index ce766ac485..1bc1fc73e5 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -322,7 +322,7 @@ typedef void EndTransferFunc(IDEState *); typedef void DMAStartFunc(IDEDMA *, IDEState *, BlockCompletionFunc *); typedef void DMAVoidFunc(IDEDMA *); -typedef int DMAIntFunc(IDEDMA *, int); +typedef int DMAIntFunc(IDEDMA *, bool); typedef int32_t DMAInt32Func(IDEDMA *, int32_t len); typedef void DMAu32Func(IDEDMA *, uint32_t); typedef void DMAStopFunc(IDEDMA *, bool); diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index ca0becd756..21e2c360ac 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -590,7 +590,7 @@ static const VMStateDescription vmstate_rc4030 = { }; static void rc4030_do_dma(void *opaque, int n, uint8_t *buf, - int len, int is_write) + int len, bool is_write) { rc4030State *s = opaque; hwaddr dma_addr; @@ -630,13 +630,13 @@ struct rc4030DMAState { void rc4030_dma_read(void *dma, uint8_t *buf, int len) { rc4030_dma s = dma; - rc4030_do_dma(s->opaque, s->n, buf, len, 0); + rc4030_do_dma(s->opaque, s->n, buf, len, false); } void rc4030_dma_write(void *dma, uint8_t *buf, int len) { rc4030_dma s = dma; - rc4030_do_dma(s->opaque, s->n, buf, len, 1); + rc4030_do_dma(s->opaque, s->n, buf, len, true); } static rc4030_dma *rc4030_allocate_dmas(void *opaque, int n) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 68264a22e8..13d91e109a 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1461,7 +1461,7 @@ static void ahci_commit_buf(IDEDMA *dma, uint32_t tx_bytes) ad->cur_cmd->status = cpu_to_le32(tx_bytes); } -static int ahci_dma_rw_buf(IDEDMA *dma, int is_write) +static int ahci_dma_rw_buf(IDEDMA *dma, bool is_write) { AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma); IDEState *s = &ad->port.ifs[0]; diff --git a/hw/ide/core.c b/hw/ide/core.c index 80000eb766..689bb36409 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2570,7 +2570,7 @@ static void ide_init1(IDEBus *bus, int unit) ide_sector_write_timer_cb, s); } -static int ide_nop_int(IDEDMA *dma, int x) +static int ide_nop_int(IDEDMA *dma, bool is_write) { return 0; } diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 7a8470e921..a9f25e5d02 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -376,7 +376,7 @@ static void macio_ide_reset(DeviceState *dev) ide_bus_reset(&d->bus); } -static int ide_nop_int(IDEDMA *dma, int x) +static int ide_nop_int(IDEDMA *dma, bool is_write) { return 0; } diff --git a/hw/ide/pci.c b/hw/ide/pci.c index cce1da804d..1a6a287e76 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -181,7 +181,7 @@ static int32_t bmdma_prepare_buf(IDEDMA *dma, int32_t limit) } /* return 0 if buffer completed */ -static int bmdma_rw_buf(IDEDMA *dma, int is_write) +static int bmdma_rw_buf(IDEDMA *dma, bool is_write) { BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); IDEState *s = bmdma_active_if(bm);