From patchwork Tue Nov 22 00:20:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Chubb X-Patchwork-Id: 126976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 97650B71F0 for ; Tue, 22 Nov 2011 11:21:03 +1100 (EST) Received: from localhost ([::1]:33093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSe6Z-0006a8-BE for incoming@patchwork.ozlabs.org; Mon, 21 Nov 2011 19:20:55 -0500 Received: from eggs.gnu.org ([140.186.70.92]:54596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSe6L-0006C3-7k for qemu-devel@nongnu.org; Mon, 21 Nov 2011 19:20:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSe6G-0002qY-Vb for qemu-devel@nongnu.org; Mon, 21 Nov 2011 19:20:41 -0500 Received: from lemon.ertos.nicta.com.au ([203.143.174.143]:32835 helo=lemon.ken.nicta.com.au) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSe6G-0002qK-MV for qemu-devel@nongnu.org; Mon, 21 Nov 2011 19:20:36 -0500 Received: from [2402:1800:4000:2:224:d7ff:feaf:390] (port=55052 helo=Diprotodon.keg.ertos.in.nicta.com.au.chubb.wattle.id.au) by lemon.ken.nicta.com.au with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1RSe5x-0004tE-9u; Tue, 22 Nov 2011 11:20:21 +1100 Date: Tue, 22 Nov 2011 11:20:16 +1100 Message-ID: From: Peter Chubb To: Andreas =?UTF-8?B?RsOkcmJlcg==?= In-Reply-To: <4ECAD841.1090307@web.de> References: <4ECAD841.1090307@web.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/23.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-Face: GgFg(Z>fx((4\32hvXq<)|jndSniCH~~$D)Ka:P@e@JR1P%Vr}EwUdfwf-4j\rUs#JR{'h# !]])6%Jh~b$VA|ALhnpPiHu[-x~@<"@Iv&|%R)Fq[[, (&Z'O)Q)xCqe1\M[F8#9l8~}#u$S$Rm`S9% \'T@`:&8>Sb*c5d'=eDYI&GF`+t[LfDH="MP5rwOO]w>ALi7'=QJHz&y&C&TE_3j! Organization: National ICT Australia MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") X-SA-Exim-Connect-IP: 2402:1800:4000:2:224:d7ff:feaf:390 X-SA-Exim-Mail-From: peter.chubb@nicta.com.au X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:52:44 +0000) X-SA-Exim-Scanned: Yes (on lemon.ken.nicta.com.au) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 203.143.174.143 Cc: Peter Maydell , davidm@ok-labs.com, qemu-devel@nongnu.org, Peter Chubb , Paul Brook , Peter Chubb , philipo@ok-labs.com Subject: Re: [Qemu-devel] [PATCH] [ARM] fix function names in error messages in arm_timer.c 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 Fix names of functions in error messages: as suggested by Andreas Färber, use the C99 standard __func__ macro to get the correct name. This fixes one real bug (the message used to print sp804 instead of icp_pit), the other changes are cosmetic. Signed-off-by: Peter Chubb --- hw/arm_timer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au http://www.ertos.nicta.com.au ERTOS within National ICT Australia Index: qemu-working/hw/arm_timer.c =================================================================== --- qemu-working.orig/hw/arm_timer.c 2011-11-22 10:43:02.575959499 +1100 +++ qemu-working/hw/arm_timer.c 2011-11-22 11:12:06.461275640 +1100 @@ -54,21 +54,21 @@ static uint32_t arm_timer_read(void *opa return ptimer_get_count(s->timer); case 2: /* TimerControl */ return s->control; case 4: /* TimerRIS */ return s->int_level; case 5: /* TimerMIS */ if ((s->control & TIMER_CTRL_IE) == 0) return 0; return s->int_level; default: - hw_error("arm_timer_read: Bad offset %x\n", (int)offset); + hw_error("%s: Bad offset %x\n", __func__, (int)offset); return 0; } } /* Reset the timer limit after settings have changed. */ static void arm_timer_recalibrate(arm_timer_state *s, int reload) { uint32_t limit; if ((s->control & (TIMER_CTRL_PERIODIC | TIMER_CTRL_ONESHOT)) == 0) { @@ -121,21 +121,21 @@ static void arm_timer_write(void *opaque } break; case 3: /* TimerIntClr */ s->int_level = 0; break; case 6: /* TimerBGLoad */ s->limit = value; arm_timer_recalibrate(s, 0); break; default: - hw_error("arm_timer_write: Bad offset %x\n", (int)offset); + hw_error("%s: Bad offset %x\n", __func__, (int)offset); } arm_timer_update(s); } static void arm_timer_tick(void *opaque) { arm_timer_state *s = (arm_timer_state *)opaque; s->int_level = 1; arm_timer_update(s); } @@ -263,35 +263,35 @@ typedef struct { static uint64_t icp_pit_read(void *opaque, target_phys_addr_t offset, unsigned size) { icp_pit_state *s = (icp_pit_state *)opaque; int n; /* ??? Don't know the PrimeCell ID for this device. */ n = offset >> 8; if (n > 2) { - hw_error("sp804_read: Bad timer %d\n", n); + hw_error("%s: Bad timer %d\n", __func__, n); } return arm_timer_read(s->timer[n], offset & 0xff); } static void icp_pit_write(void *opaque, target_phys_addr_t offset, uint64_t value, unsigned size) { icp_pit_state *s = (icp_pit_state *)opaque; int n; n = offset >> 8; if (n > 2) { - hw_error("sp804_write: Bad timer %d\n", n); + hw_error("%s: Bad timer %d\n", __func__, n); } arm_timer_write(s->timer[n], offset & 0xff, value); } static const MemoryRegionOps icp_pit_ops = { .read = icp_pit_read, .write = icp_pit_write, .endianness = DEVICE_NATIVE_ENDIAN, };