From nobody Thu Nov 6 12:14:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540843506812761.532396786967; Mon, 29 Oct 2018 13:05:06 -0700 (PDT) Received: from localhost ([::1]:48707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHDmP-0004kb-KH for importer@patchew.org; Mon, 29 Oct 2018 16:04:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHDkX-00039i-Io for qemu-devel@nongnu.org; Mon, 29 Oct 2018 16:02:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHDkU-0005xl-OA for qemu-devel@nongnu.org; Mon, 29 Oct 2018 16:02:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43216) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHDkU-0005xQ-Hx for qemu-devel@nongnu.org; Mon, 29 Oct 2018 16:02:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D04BAC05D3FB; Mon, 29 Oct 2018 20:02:53 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-158.ams2.redhat.com [10.36.116.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32E9210018FB; Mon, 29 Oct 2018 20:02:51 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6F244B3E01; Mon, 29 Oct 2018 21:02:50 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 29 Oct 2018 21:02:48 +0100 Message-Id: <20181029200250.24029-2-kraxel@redhat.com> In-Reply-To: <20181029200250.24029-1-kraxel@redhat.com> References: <20181029200250.24029-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 29 Oct 2018 20:02:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/3] usb: ohci: make num_ports to an unsinged integer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Li Qiang This can avoid setting OCHIState.num_ports to a negative num. Signed-off-by: Li Qiang Message-id: 1540263618-18344-1-git-send-email-liq3ea@gmail.com Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ohci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 66656a1133..c34cf5b73a 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -57,7 +57,7 @@ typedef struct { qemu_irq irq; MemoryRegion mem; AddressSpace *as; - int num_ports; + uint32_t num_ports; const char *name; =20 QEMUTimer *eof_timer; @@ -1850,7 +1850,7 @@ static USBBusOps ohci_bus_ops =3D { }; =20 static void usb_ohci_init(OHCIState *ohci, DeviceState *dev, - int num_ports, dma_addr_t localmem_base, + uint32_t num_ports, dma_addr_t localmem_base, char *masterbus, uint32_t firstport, AddressSpace *as, Error **errp) { @@ -1860,7 +1860,7 @@ static void usb_ohci_init(OHCIState *ohci, DeviceStat= e *dev, ohci->as =3D as; =20 if (num_ports > OHCI_MAX_PORTS) { - error_setg(errp, "OHCI num-ports=3D%d is too big (limit is %d port= s)", + error_setg(errp, "OHCI num-ports=3D%u is too big (limit is %u port= s)", num_ports, OHCI_MAX_PORTS); return; } --=20 2.9.3