From mboxrd@z Thu Jan 1 00:00:00 1970 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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 0946AC33C9B for ; Tue, 7 Jan 2020 16:46:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 CB5802146E for ; Tue, 7 Jan 2020 16:46:10 +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="OT2WbIEX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB5802146E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iorzd-0004O7-JA for qemu-devel@archiver.kernel.org; Tue, 07 Jan 2020 11:46:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46869) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iorlI-00086C-D6 for qemu-devel@nongnu.org; Tue, 07 Jan 2020 11:31:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iorlG-0005YN-Kj for qemu-devel@nongnu.org; Tue, 07 Jan 2020 11:31:19 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:47224 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iorlG-0005Xd-HM for qemu-devel@nongnu.org; Tue, 07 Jan 2020 11:31:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578414677; 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=mD5CnKaHCqEnDtYsfaWuvKKdqaTymxgk4zlUTmpGAA8=; b=OT2WbIEXrsyllY/Ag22SPdGMxrHtGA9AWBEgFID7NH3ulnTkBXyMBvq1fFY3C2fpHyXCKS YPI8dmiFfJLfOEkg060mYbZQLvU6D/DbNBtYoOA3A/rLMzwRGmQJpUgbRMujxZtV4c/yOO oBr6tGbIJg25g6piWVeIZ8zQJu4P+jg= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-172-39Gq8W05N5GkhesmgeZEKQ-1; Tue, 07 Jan 2020 11:31:16 -0500 Received: by mail-qt1-f198.google.com with SMTP id b14so149793qtt.1 for ; Tue, 07 Jan 2020 08:31:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=zrcV6NduOW424RfDjQAFC57USpEMc62nbflawLr92Qk=; b=ZUvBWzPn0A5ERnD2Ejus6Rbs1Gzwx2hshgN8Y4Q0y+yU2TJ2HF30Ohc1v1HSV48azn yyFrboFqaj2vxlg6Dytx7LQQgKG8ljkFdMrPeWtqhY7oahLQ3M40B0HCyZwGniTYbZYU J+MNtiQs5BrclJz9mYRHSus9NI3BnvI5ZwR5+J3ehztFR/BZd+BOmIrQcPSAjDXXxjut XkHWuO5SfwngXk/hgKzKMxYx18HmKadER2e7BAFcHNGHp+dU8n0vFqPJsc+aiv2OZtpV zFrUUHltL0X9Bv4ZLywX3wTlG+onPsAmVRZZPBjm5VU/2Izh5xab7OQNahUpu4OSAADV o96A== X-Gm-Message-State: APjAAAVit/BwSuqcc1xN2Mm0ljvdGni9hfrwUHIPmBC9WLksi5i3mHv1 LbkVE/FmzmD01SfPky57Lb5gxU2+SKdKtwtEOzDb0eREGaxdMTCGsSBcTfJv/Sc7Xb+vOa8DAma VmDykz7PV7KzKutA= X-Received: by 2002:ad4:55a7:: with SMTP id f7mr260280qvx.36.1578414674366; Tue, 07 Jan 2020 08:31:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwIZcSXc7lFqaGIHTOODsXqMqSv0VfskeWYrkHQCbJe0eVs0ekd+BeLV84arSTSdPHTLuy3dA== X-Received: by 2002:ad4:55a7:: with SMTP id f7mr260262qvx.36.1578414674160; Tue, 07 Jan 2020 08:31:14 -0800 (PST) Received: from redhat.com (bzq-79-183-34-164.red.bezeqint.net. [79.183.34.164]) by smtp.gmail.com with ESMTPSA id d143sm19992qke.123.2020.01.07.08.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 08:31:13 -0800 (PST) Date: Tue, 7 Jan 2020 11:31:10 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v3 22/32] hw/pci/pci_host: Let pci_data_[read/write] use unsigned 'size' argument Message-ID: <20200107162850.411448-23-mst@redhat.com> References: <20200107162850.411448-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200107162850.411448-1-mst@redhat.com> X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent X-MC-Unique: 39Gq8W05N5GkhesmgeZEKQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Both functions are called by MemoryRegionOps.[read/write] handlers with unsigned 'size' argument. Both functions call pci_host_config_[read/write]_common() which expect a uint32_t 'len' parameter (also unsigned). Since it is pointless (and confuse) to use a signed value, use a unsigned type. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20191216002134.18279-3-philmd@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pci_host.h | 4 ++-- hw/pci/pci_host.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/pci/pci_host.h b/include/hw/pci/pci_host.h index ba31595fc7..9ce088bd13 100644 --- a/include/hw/pci/pci_host.h +++ b/include/hw/pci/pci_host.h @@ -62,8 +62,8 @@ void pci_host_config_write_common(PCIDevice *pci_dev, uin= t32_t addr, uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr, uint32_t limit, uint32_t len); =20 -void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len); -uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len); +void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, unsigned len); +uint32_t pci_data_read(PCIBus *s, uint32_t addr, unsigned len); =20 extern const MemoryRegionOps pci_host_conf_le_ops; extern const MemoryRegionOps pci_host_conf_be_ops; diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c index 0958d157de..ce7bcdb1d5 100644 --- a/hw/pci/pci_host.c +++ b/hw/pci/pci_host.c @@ -106,7 +106,7 @@ uint32_t pci_host_config_read_common(PCIDevice *pci_dev= , uint32_t addr, return ret; } =20 -void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len) +void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, unsigned len) { PCIDevice *pci_dev =3D pci_dev_find_by_addr(s, addr); uint32_t config_addr =3D addr & (PCI_CONFIG_SPACE_SIZE - 1); @@ -119,7 +119,7 @@ void pci_data_write(PCIBus *s, uint32_t addr, uint32_t = val, int len) val, len); } =20 -uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len) +uint32_t pci_data_read(PCIBus *s, uint32_t addr, unsigned len) { PCIDevice *pci_dev =3D pci_dev_find_by_addr(s, addr); uint32_t config_addr =3D addr & (PCI_CONFIG_SPACE_SIZE - 1); --=20 MST