From patchwork Tue Mar 1 15:57:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Galvan X-Patchwork-Id: 8466411 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E486E9F8A8 for ; Tue, 1 Mar 2016 15:58:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3764320160 for ; Tue, 1 Mar 2016 15:58:41 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 7FF332014A for ; Tue, 1 Mar 2016 15:58:40 +0000 (UTC) Received: from localhost ([::1]:50529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aamh5-0007j1-Ty for patchwork-qemu-devel@patchwork.kernel.org; Tue, 01 Mar 2016 10:58:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aamgq-0007d3-2W for qemu-devel@nongnu.org; Tue, 01 Mar 2016 10:58:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aamgm-0006Sj-2D for qemu-devel@nongnu.org; Tue, 01 Mar 2016 10:58:24 -0500 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]:33456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aamgl-0006SM-UG for qemu-devel@nongnu.org; Tue, 01 Mar 2016 10:58:20 -0500 Received: by mail-qg0-x234.google.com with SMTP id d32so89216925qgd.0 for ; Tue, 01 Mar 2016 07:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tallertechnologies.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=0tbRy0U8culNnM/8gD/9ePQzE7PGVSa427xS0MMH5pI=; b=H1Pjt9V9rwcUIF3UEB+qp8AqAuECgs/Xz6hj9Ff/0SQfbS4eTscq4UwEkfPgqi0WAa CwK5Ev+SoqoICAM1sDI9GgMhXqQZavlxzryPcguXOZFVy1ZgZKgrDj/3KtdO2D7IouLf JKAP+SBYH1Aa8JZcPxX2IjwYWIU7qhHhplSI4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=0tbRy0U8culNnM/8gD/9ePQzE7PGVSa427xS0MMH5pI=; b=ZOg1yMHYj5I5unXwPEDoXI6gHYzxzVjbm26KKsMO4sq58vmjPrliLphlYLOkBlgQUN rJSvrSGVCe1Ncnr11fLUCXZAaXrHGdDrQi2y9tXTRIEmIcXi3xVvwoetaAxtrifnSu9v eZE2/xGubBZMauxYVY0zu6MM3vVBO4xygGH689LggZ20j+AB9fpQDh+I4WrbOJI1BSJl s2VURp0d9oY82EqtCju2cr2HH8EekQMb60cwu6CmozyugniQ10yUzADbeH74+NdltNuI cEgL0PfFL2yulk4onzDgCgiTSlA9bODY+ozFFedMcwZQdgaO2mL0OHvH1F/QfzfQSmt/ VDvw== X-Gm-Message-State: AD7BkJK67b1u+oaivmIi6SZpuWU6KCK693WRRj1CgBN/k8HkVrm4uk8wr3T6o7U32LQ85QPe X-Received: by 10.141.2.198 with SMTP id e189mr29144808qhd.64.1456847899575; Tue, 01 Mar 2016 07:58:19 -0800 (PST) Received: from martin-galvan.dominio.tallertechnologies.com ([200.69.202.173]) by smtp.gmail.com with ESMTPSA id 123sm13109030qhu.22.2016.03.01.07.58.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 07:58:19 -0800 (PST) From: Martin Galvan To: qemu-devel@nongnu.org, peter.maydell@linaro.org, pbonzini@redhat.com, edgar.iglesias@gmail.com, rth@twiddle.net, aurelien@aurel32.net, kraxel@redhat.com, blauwirbel@gmail.com, lcapitulino@redhat.com, armbru@redhat.com, afaerber@suse.de, dmitry@daynix.com Date: Tue, 1 Mar 2016 12:57:39 -0300 Message-Id: <1456847859-4771-13-git-send-email-martin.galvan@tallertechnologies.com> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1456847859-4771-1-git-send-email-martin.galvan@tallertechnologies.com> References: <1456847650-4476-1-git-send-email-martin.galvan@tallertechnologies.com> <1456847859-4771-1-git-send-email-martin.galvan@tallertechnologies.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c04::234 Subject: [Qemu-devel] [PATCH v2 13/13] Use unsigned types for the 'len' argument of all memory read/write functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP --- dma-helpers.c | 2 +- gdbstub.c | 3 ++- hw/dma/sun4m_iommu.c | 4 ++-- hw/net/dp8393x.c | 8 ++++---- hw/net/mcf_fec.c | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) --- 2.7.1 diff --git a/dma-helpers.c b/dma-helpers.c index 4ad0bca..8e56ec5 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -22,7 +22,7 @@ int dma_memory_set(AddressSpace *as, dma_addr_t addr, uint8_t c, dma_addr_t len) #define FILLBUF_SIZE 512 uint8_t fillbuf[FILLBUF_SIZE]; - int l; + size_t l; bool error = false; memset(fillbuf, c, FILLBUF_SIZE); diff --git a/gdbstub.c b/gdbstub.c index 61c12b1..21b2990 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -42,7 +42,8 @@ #endif static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr, - uint8_t *buf, int len, bool is_write) + uint8_t *buf, size_t len, + bool is_write) { CPUClass *cc = CPU_GET_CLASS(cpu); diff --git a/hw/dma/sun4m_iommu.c b/hw/dma/sun4m_iommu.c index b3cbc54..5ce998a 100644 --- a/hw/dma/sun4m_iommu.c +++ b/hw/dma/sun4m_iommu.c @@ -293,9 +293,9 @@ static void iommu_bad_addr(IOMMUState *s, hwaddr addr, } void sparc_iommu_memory_rw(void *opaque, hwaddr addr, - uint8_t *buf, int len, int is_write) + uint8_t *buf, size_t len, int is_write) { - int l; + size_t l; uint32_t flags; hwaddr page, phys_addr; diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index e847b77..136b1ad 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -194,7 +194,7 @@ static void dp8393x_update_irq(dp8393xState *s) static void dp8393x_do_load_cam(dp8393xState *s) { uint16_t data[8]; - int width, size; + size_t width, size; uint16_t index = 0; width = (s->regs[SONIC_DCR] & SONIC_DCR_DW) ? 2 : 1; @@ -236,7 +236,7 @@ static void dp8393x_do_load_cam(dp8393xState *s) static void dp8393x_do_read_rra(dp8393xState *s) { uint16_t data[8]; - int width, size; + size_t width, size; /* Read memory */ width = (s->regs[SONIC_DCR] & SONIC_DCR_DW) ? 2 : 1; @@ -347,8 +347,8 @@ static void dp8393x_do_transmit_packets(dp8393xState *s) { NetClientState *nc = qemu_get_queue(s->nic); uint16_t data[12]; - int width, size; - int tx_len, len; + size_t width, size; + size_t tx_len, len; uint16_t i; width = (s->regs[SONIC_DCR] & SONIC_DCR_DW) ? 2 : 1; diff --git a/hw/net/mcf_fec.c b/hw/net/mcf_fec.c index 7c0398e..59c3c97 100644 --- a/hw/net/mcf_fec.c +++ b/hw/net/mcf_fec.c @@ -148,8 +148,8 @@ static void mcf_fec_do_tx(mcf_fec_state *s) { uint32_t addr; mcf_fec_bd bd; - int frame_size; - int len; + size_t frame_size; + size_t len; uint8_t frame[FEC_MAX_FRAME_SIZE]; uint8_t *ptr;