[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 12/15] hw/timer: Replace fprintf(stderr, "*\n" wi
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v7 12/15] hw/timer: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Fri, 2 Feb 2018 19:37:28 +0100 |
From: Alistair Francis <address@hidden>
Replace a large number of the fprintf(stderr, "*\n" calls with
error_report(). The functions were renamed with these commands and then
compiler issues where manually fixed.
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N;N; {s|fprintf(stderr,
"\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'
\
{} +
find ./* -type f -exec sed -i \
'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
find ./* -type f -exec sed -i \
'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
{} +
Some lines where then manually tweaked to pass checkpatch.
Signed-off-by: Alistair Francis <address@hidden>
Conversions that aren't followed by exit() dropped, because they might
be inappropriate.
Signed-off-by: Markus Armbruster <address@hidden>
---
hw/timer/xilinx_timer.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c
index 59439c05be..2d658b5791 100644
--- a/hw/timer/xilinx_timer.c
+++ b/hw/timer/xilinx_timer.c
@@ -127,7 +127,7 @@ timer_read(void *opaque, hwaddr addr, unsigned int size)
break;
}
- D(fprintf(stderr, "%s timer=%d %x=%x\n", __func__, timer, addr * 4, r));
+ D(error_report("%s timer=%d %x=%x", __func__, timer, addr * 4, r));
return r;
}
@@ -135,8 +135,8 @@ static void timer_enable(struct xlx_timer *xt)
{
uint64_t count;
- D(fprintf(stderr, "%s timer=%d down=%d\n", __func__,
- xt->nr, xt->regs[R_TCSR] & TCSR_UDT));
+ D(error_report("%s timer=%d down=%d", __func__,
+ xt->nr, xt->regs[R_TCSR] & TCSR_UDT));
ptimer_stop(xt->ptimer);
@@ -160,7 +160,7 @@ timer_write(void *opaque, hwaddr addr,
addr >>= 2;
timer = timer_from_addr(addr);
xt = &t->timers[timer];
- D(fprintf(stderr, "%s addr=%x val=%x (timer=%d off=%d)\n",
+ D(error_report("%s addr=%x val=%x (timer=%d off=%d)",
__func__, addr * 4, value, timer, addr & 3));
/* Further decoding to address a specific timers reg. */
addr &= 3;
@@ -197,7 +197,7 @@ static void timer_hit(void *opaque)
{
struct xlx_timer *xt = opaque;
struct timerblock *t = xt->parent;
- D(fprintf(stderr, "%s %d\n", __func__, xt->nr));
+ D(error_report("%s %d", __func__, xt->nr));
xt->regs[R_TCSR] |= TCSR_TINT;
if (xt->regs[R_TCSR] & TCSR_ARHT)
--
2.13.6
- [Qemu-devel] [PATCH v7 00/15] Remove some of the fprintf(stderr, "*, Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 04/15] hw/lm32: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 09/15] hw/ppc: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 06/15] hw/moxie: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 11/15] hw/sparc*: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 14/15] tcg: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 07/15] hw/openrisc: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 12/15] hw/timer: Replace fprintf(stderr, "*\n" with error_report(),
Markus Armbruster <=
- [Qemu-devel] [PATCH v7 05/15] hw/mips: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 10/15] hw/sd: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 01/15] audio: Replace AUDIO_FUNC with __func__, Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 13/15] hw/xen*: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 08/15] hw/pci*: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH v7 03/15] hw/dma: Replace fprintf(stderr, "*\n" with error_report(), Markus Armbruster, 2018/02/02