From patchwork Tue Feb 11 06:29:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 319141 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 56ED42C007A for ; Tue, 11 Feb 2014 17:31:26 +1100 (EST) Received: from localhost ([::1]:59771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD6sO-00038D-7l for incoming@patchwork.ozlabs.org; Tue, 11 Feb 2014 01:31:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD6rT-0002O4-KD for qemu-devel@nongnu.org; Tue, 11 Feb 2014 01:30:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WD6rN-000858-EW for qemu-devel@nongnu.org; Tue, 11 Feb 2014 01:30:27 -0500 Received: from mail-qc0-f180.google.com ([209.85.216.180]:54762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD6rN-00084j-BB for qemu-devel@nongnu.org; Tue, 11 Feb 2014 01:30:21 -0500 Received: by mail-qc0-f180.google.com with SMTP id i17so12492289qcy.11 for ; Mon, 10 Feb 2014 22:30:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=NLKhigxiA8fEmZbPS39/osP/PT12YCElxmMqy60eBoU=; b=IwrIeNlzsX4yhN1yMVgR8vJI0pedw/GQLfAWJN6ioy5Q9pjyKyY+12SIiaAuLMTNbt pGLTH8bTrtSWcZNP0P2H8dDtZrCspJbuuPw6/Q5veTj+2fENm/g97T58uAN+k0EeAtqN I3/l6XQ8xSwY+szWx6bODtGySpRSgw9UF/zZPSav2gtdgIXdFRDbNBdMVMKHldaED6rz vxbJV/WoVxE76JKLEHjKQY4MyfjerfXA2XecNJ2yH8jFUkYJJevz4dUSR89SFAzi+YP3 J/7QmvbzUS0uPES6Zy8ptApeMed6LSyWkF3iWInJ309rMEWXeeO45TlP/iDixl80m4Y2 bKeg== X-Gm-Message-State: ALoCoQl46a+E7GJING8Te5a0pdo7oWq0iTp+NINo3wSR+7jYLwQtkr0hT2X9VWcrUkafRcyEVW9D X-Received: by 10.224.137.5 with SMTP id u5mr55206270qat.12.1392100221033; Mon, 10 Feb 2014 22:30:21 -0800 (PST) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPSA id e2sm50181844qab.20.2014.02.10.22.30.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 10 Feb 2014 22:30:20 -0800 (PST) From: Peter Crosthwaite To: qemu-devel@nongnu.org Date: Mon, 10 Feb 2014 22:29:48 -0800 Message-Id: <4498dc66d8f8c4ccb4c1d9c5330423deb4accf79.1392099904.git.peter.crosthwaite@xilinx.com> X-Mailer: git-send-email 1.8.5.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.216.180 Cc: peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH target-arm v1 3/7] dma/pl330: printf format type sweep. 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Use PRI formats as appropriate rather than raw %x and %d. This fixes debug printfery on some host platforms. Fix types of debug only variables as appropriate. Signed-off-by: Peter Crosthwaite --- hw/dma/pl330.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index d36f0bc..a4cc6f9 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -577,7 +577,7 @@ static inline void pl330_queue_remove_tagged(PL330Queue *s, uint8_t tag) static inline void pl330_fault(PL330Chan *ch, uint32_t flags) { - DB_PRINT("ch: %p, flags: %x\n", ch, flags); + DB_PRINT("ch: %p, flags: %" PRIx32 "\n", ch, flags); ch->fault_type |= flags; if (ch->state == pl330_chan_fault) { return; @@ -723,7 +723,8 @@ static void pl330_dmald(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) ch->stall = pl330_queue_put_insn(&ch->parent->read_queue, ch->src, size, num, inc, 0, ch->tag); if (!ch->stall) { - DB_PRINT("channel:%d address:%08x size:%d num:%d %c\n", + DB_PRINT("channel:%" PRId8 " address:%08" PRIx32 " size:%" PRIx32 + " num:%" PRId32 " %c\n", ch->tag, ch->src, size, num, inc ? 'Y' : 'N'); ch->src += inc ? size * num - (ch->src & (size - 1)) : 0; } @@ -868,7 +869,7 @@ static void pl330_dmasev(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) } if (ch->parent->inten & (1 << ev_id)) { ch->parent->int_status |= (1 << ev_id); - DB_PRINT("event interrupt raised %d\n", ev_id); + DB_PRINT("event interrupt raised %" PRId8 "\n", ev_id); qemu_irq_raise(ch->parent->irq[ev_id]); } ch->parent->ev_status |= (1 << ev_id); @@ -895,7 +896,8 @@ static void pl330_dmast(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) ch->stall = pl330_queue_put_insn(&ch->parent->write_queue, ch->dst, size, num, inc, 0, ch->tag); if (!ch->stall) { - DB_PRINT("channel:%d address:%08x size:%d num:%d %c\n", + DB_PRINT("channel:%" PRId8 " address:%08" PRIx32 " size:%" PRIx32 + " num:%" PRId32 " %c\n", ch->tag, ch->dst, size, num, inc ? 'Y' : 'N'); ch->dst += inc ? size * num - (ch->dst & (size - 1)) : 0; } @@ -1154,7 +1156,7 @@ static int pl330_exec_cycle(PL330Chan *channel) dma_memory_read(&address_space_memory, q->addr, buf, len); if (PL330_ERR_DEBUG > 1) { - DB_PRINT("PL330 read from memory @%08x (size = %08x):\n", + DB_PRINT("PL330 read from memory @%08" PRIx32 " (size = %08x):\n", q->addr, len); qemu_hexdump((char *)buf, stderr, "", len); } @@ -1186,8 +1188,8 @@ static int pl330_exec_cycle(PL330Chan *channel) if (fifo_res == PL330_FIFO_OK || q->z) { dma_memory_write(&address_space_memory, q->addr, buf, len); if (PL330_ERR_DEBUG > 1) { - DB_PRINT("PL330 read from memory @%08x (size = %08x):\n", - q->addr, len); + DB_PRINT("PL330 read from memory @%08" PRIx32 + " (size = %08x):\n", q->addr, len); qemu_hexdump((char *)buf, stderr, "", len); } if (q->inc) { @@ -1276,7 +1278,7 @@ static void pl330_debug_exec(PL330State *s) args[2] = (s->dbg[1] >> 8) & 0xff; args[3] = (s->dbg[1] >> 16) & 0xff; args[4] = (s->dbg[1] >> 24) & 0xff; - DB_PRINT("chan id: %d\n", chan_id); + DB_PRINT("chan id: %" PRIx8 "\n", chan_id); if (s->dbg[0] & 1) { ch = &s->chan[chan_id]; } else { @@ -1466,8 +1468,8 @@ static inline uint32_t pl330_iomem_read_imp(void *opaque, static uint64_t pl330_iomem_read(void *opaque, hwaddr offset, unsigned size) { - int ret = pl330_iomem_read_imp(opaque, offset); - DB_PRINT("addr: %08x data: %08x\n", (unsigned)offset, ret); + uint32_t ret = pl330_iomem_read_imp(opaque, offset); + DB_PRINT("addr: %08" HWADDR_PRIx " data: %08" PRIx32 "\n", offset, ret); return ret; } @@ -1553,7 +1555,7 @@ static void pl330_realize(DeviceState *dev, Error **errp) s->cfg[1] |= 5; break; default: - error_setg(errp, "Bad value for i-cache_len property: %d\n", + error_setg(errp, "Bad value for i-cache_len property: %" PRIx8 "\n", s->i_cache_len); return; } @@ -1588,7 +1590,7 @@ static void pl330_realize(DeviceState *dev, Error **errp) s->cfg[CFG_CRD] |= 0x4; break; default: - error_setg(errp, "Bad value for data_width property: %d\n", + error_setg(errp, "Bad value for data_width property: %" PRIx8 "\n", s->data_width); return; }