From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sb8CA-00075k-DG for qemu-devel@nongnu.org; Sun, 03 Jun 2012 06:38:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sb8C8-0000Oq-C6 for qemu-devel@nongnu.org; Sun, 03 Jun 2012 06:38:01 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:33880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sb8C7-0000OY-QF for qemu-devel@nongnu.org; Sun, 03 Jun 2012 06:38:00 -0400 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 3 Jun 2012 12:38:08 +0200 Message-Id: <1338719890-9935-7-git-send-email-hpoussin@reactos.org> In-Reply-To: <1338719890-9935-1-git-send-email-hpoussin@reactos.org> References: <1338719890-9935-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 6/7] esp: use error_report()/hw_error() instead of stderr output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Kevin Wolf , Paolo Bonzini , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , "Michael S. Tsirkin" Use error_report() for guest errors, hw_error() for unimplemented parts. Signed-off-by: Herv=C3=A9 Poussineau --- hw/esp.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/esp.c b/hw/esp.c index 714069b..e3425bb 100644 --- a/hw/esp.c +++ b/hw/esp.c @@ -35,9 +35,6 @@ * http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53= C9X.txt */ =20 -#define ESP_ERROR(fmt, ...) = \ - do { printf("ESP ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } whi= le (0) - #define ESP_REGS 16 #define TI_BUFSZ 16 =20 @@ -498,7 +495,7 @@ static uint64_t esp_reg_read(ESPState *s, uint32_t sa= ddr) s->ti_size--; if ((s->rregs[ESP_RSTAT] & STAT_PIO_MASK) =3D=3D 0) { /* Data out. */ - ESP_ERROR("PIO data read not implemented\n"); + hw_error("esp: PIO data read not implemented"); s->rregs[ESP_FIFO] =3D 0; } else { s->rregs[ESP_FIFO] =3D s->ti_buf[s->ti_rptr++]; @@ -538,7 +535,7 @@ static void esp_reg_write(ESPState *s, uint32_t saddr= , uint64_t val) if (s->do_cmd) { s->cmdbuf[s->cmdlen++] =3D val & 0xff; } else if (s->ti_size =3D=3D TI_BUFSZ - 1) { - ESP_ERROR("fifo overrun\n"); + error_report("esp: fifo overrun"); } else { s->ti_size++; s->ti_buf[s->ti_wptr++] =3D val & 0xff; @@ -626,7 +623,7 @@ static void esp_reg_write(ESPState *s, uint32_t saddr= , uint64_t val) esp_raise_irq(s); break; default: - ESP_ERROR("Unhandled ESP command (%2.2x)\n", (unsigned)val); + error_report("esp: unhandled command (%2.2x)", (unsigned)val= ); break; } break; @@ -641,7 +638,8 @@ static void esp_reg_write(ESPState *s, uint32_t saddr= , uint64_t val) s->rregs[saddr] =3D val; break; default: - ESP_ERROR("invalid write of 0x%02x at [0x%x]\n", (unsigned)val, = saddr); + error_report("esp: invalid write of 0x%02x at [0x%x]", + (unsigned int)val, saddr); return; } s->wregs[saddr] =3D val; --=20 1.7.10