From patchwork Tue Oct 23 03:00:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10652673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1421A17D4 for ; Tue, 23 Oct 2018 03:01:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCC2F28E3D for ; Tue, 23 Oct 2018 03:01:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABC7928E33; Tue, 23 Oct 2018 03:01:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 06D7628E33 for ; Tue, 23 Oct 2018 03:01:28 +0000 (UTC) Received: from localhost ([::1]:37825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEmwh-0000Gm-OI for patchwork-qemu-devel@patchwork.kernel.org; Mon, 22 Oct 2018 23:01:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEmvq-0008M6-Rg for qemu-devel@nongnu.org; Mon, 22 Oct 2018 23:00:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEmvn-0000nV-Ld for qemu-devel@nongnu.org; Mon, 22 Oct 2018 23:00:34 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:43050) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gEmvl-0000kq-J3 for qemu-devel@nongnu.org; Mon, 22 Oct 2018 23:00:31 -0400 Received: by mail-pf1-x441.google.com with SMTP id q1-v6so3587313pfh.10 for ; Mon, 22 Oct 2018 20:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=7+dwaCOWqZMUTBvA5oj2P8ac66fks0LKi7gqhe/9vpI=; b=q5753P1Ummp7H8f4dP4XwRSg1SOszTjwxC42D7JFrc80zXAeQ3rPHL5UErmiamsidr B1Elw3DD1efwqCyH2orFm+Btbqd4nkNpAxrQmD6F1bl91xGjGkCPkjNIHaxU1yRqQg+K 63epXT6FcOcw1KZs8LWy6EJPscIhFCdPtZpj6hmazoZ4j3cEFvjHsPEAogxon073ig7Z LTwgJ7/3u38J0k43YkZkSSnrjG2ftuHvu1zoI2j4lFvj780WS68Dznfsy2npq/kDfyql X7CO5uAgCq6m1JLS8LQaR2Msue0fdiAa2E65zBnUAAK2JHSkiJRqc28wYl1hG6iFlDyd qZUw== 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; bh=7+dwaCOWqZMUTBvA5oj2P8ac66fks0LKi7gqhe/9vpI=; b=RGua8xTUeyy4CvEgmA+F3ARbvkUQRVN4VVflmHmT01tIookZ12fJtRMfEhQUyDxiPy BxBmWnXkJJrb+J9JMjNmSKD3S5eMblitfijy1RHCq2EcPxWrby7JBaAlrfzttjBnMG0d JNv1lTeEyF5g5b80e2CzAQ0FXQkYT4soHFZqYBUFMNZuNvwJvGyRCNMHTLvC2NX1Mx8D yYJVYByCI9larInAjMC7WsRmTCuxPb8nw6fuDqQialydxIC7pwjJCANwseZcd+3P85p2 Xd1wYY9Beqj/FQMo8dehwFol2ZeCwPIBkcYa8oAFaiuBFM81z5rbYm0kdo0J8VySl4YB XwNQ== X-Gm-Message-State: AGRZ1gJ7lJgFs2Z9O5MEfRs/LsiaagTg7ib+E7Db7zTVLKsPnqDZt4+x jLFWtEPSBXsVAw1WgHPtLDg= X-Google-Smtp-Source: AJdET5f2lZ/abOCMW4aeJVDfduFgKzKNou6UQsO58P1XyoPMsWY0mhLUVC4TNyTVPQRwf+fz3hNDew== X-Received: by 2002:a63:dc54:: with SMTP id f20mr1117348pgj.410.1540263624363; Mon, 22 Oct 2018 20:00:24 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.65]) by smtp.gmail.com with ESMTPSA id b19-v6sm35266851pfo.50.2018.10.22.20.00.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 20:00:23 -0700 (PDT) From: Li Qiang To: kraxel@redhat.com Date: Mon, 22 Oct 2018 20:00:18 -0700 Message-Id: <1540263618-18344-1-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [PATCH] 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 , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This can avoid setting OCHIState.num_ports to a negative num. Signed-off-by: Li Qiang --- 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 66656a1..c34cf5b 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; QEMUTimer *eof_timer; @@ -1850,7 +1850,7 @@ static USBBusOps ohci_bus_ops = { }; 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, DeviceState *dev, ohci->as = as; if (num_ports > OHCI_MAX_PORTS) { - error_setg(errp, "OHCI num-ports=%d is too big (limit is %d ports)", + error_setg(errp, "OHCI num-ports=%u is too big (limit is %u ports)", num_ports, OHCI_MAX_PORTS); return; }