[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 04/15] hw/lm32: Replace fprintf(stderr, "*\n" wit
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v7 04/15] hw/lm32: Replace fprintf(stderr, "*\n" with error_report() |
Date: |
Fri, 2 Feb 2018 19:37:20 +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>
Cc: Michael Walle <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Acked-by: Michael Walle <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
hw/lm32/lm32_boards.c | 7 +++----
hw/lm32/milkymist.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
index 002d638edd..527bcc229c 100644
--- a/hw/lm32/lm32_boards.c
+++ b/hw/lm32/lm32_boards.c
@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "qemu-common.h"
#include "cpu.h"
#include "hw/sysbus.h"
@@ -148,8 +149,7 @@ static void lm32_evr_init(MachineState *machine)
}
if (kernel_size < 0) {
- fprintf(stderr, "qemu: could not load kernel '%s'\n",
- kernel_filename);
+ error_report("could not load kernel '%s'", kernel_filename);
exit(1);
}
}
@@ -242,8 +242,7 @@ static void lm32_uclinux_init(MachineState *machine)
}
if (kernel_size < 0) {
- fprintf(stderr, "qemu: could not load kernel '%s'\n",
- kernel_filename);
+ error_report("could not load kernel '%s'", kernel_filename);
exit(1);
}
}
diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
index d4e765f2eb..85d64fe58d 100644
--- a/hw/lm32/milkymist.c
+++ b/hw/lm32/milkymist.c
@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "qemu-common.h"
#include "cpu.h"
#include "hw/sysbus.h"
@@ -145,8 +146,7 @@ milkymist_init(MachineState *machine)
/* if no kernel is given no valid bios rom is a fatal error */
if (!kernel_filename && !dinfo && !bios_filename && !qtest_enabled()) {
- fprintf(stderr, "qemu: could not load Milkymist One bios '%s'\n",
- bios_name);
+ error_report("could not load Milkymist One bios '%s'", bios_name);
exit(1);
}
g_free(bios_filename);
@@ -184,8 +184,7 @@ milkymist_init(MachineState *machine)
}
if (kernel_size < 0) {
- fprintf(stderr, "qemu: could not load kernel '%s'\n",
- kernel_filename);
+ error_report("could not load kernel '%s'", kernel_filename);
exit(1);
}
}
--
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 <=
- [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, 2018/02/02
- [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