summaryrefslogtreecommitdiffstats
path: root/hw/ppc/ppc440_bamboo.c
diff options
context:
space:
mode:
authorAlistair Francis2018-02-03 09:43:10 +0100
committerMarkus Armbruster2018-02-06 18:29:26 +0100
commit6f76b817b51806f7a41e963e637804e73b30b46a (patch)
treeed0e3cd17f940d3c8d5b3f07db57f67ed5b0a6a1 /hw/ppc/ppc440_bamboo.c
parenthw/pci*: Replace fprintf(stderr, "*\n" with error_report() (diff)
downloadqemu-6f76b817b51806f7a41e963e637804e73b30b46a.tar.gz
qemu-6f76b817b51806f7a41e963e637804e73b30b46a.tar.xz
qemu-6f76b817b51806f7a41e963e637804e73b30b46a.zip
hw/ppc: Replace fprintf(stderr, "*\n" with error_report()
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 were then manually tweaked to pass checkpatch and some curly braces were added to match QEMU style. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Cc: qemu-ppc@nongnu.org Conversions that aren't followed by exit() dropped, because they might be inappropriate. Also trim trailing punctuation from error messages. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180203084315.20497-10-armbru@redhat.com>
Diffstat (limited to 'hw/ppc/ppc440_bamboo.c')
-rw-r--r--hw/ppc/ppc440_bamboo.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index a299206fd4..8641986a71 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -12,6 +12,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "net/net.h"
@@ -188,8 +189,8 @@ static void bamboo_init(MachineState *machine)
env = &cpu->env;
if (env->mmu_model != POWERPC_MMU_BOOKE) {
- fprintf(stderr, "MMU model %i not supported by this machine.\n",
- env->mmu_model);
+ error_report("MMU model %i not supported by this machine",
+ env->mmu_model);
exit(1);
}
@@ -229,7 +230,7 @@ static void bamboo_init(MachineState *machine)
NULL);
pcibus = (PCIBus *)qdev_get_child_bus(dev, "pci.0");
if (!pcibus) {
- fprintf(stderr, "couldn't create PCI controller!\n");
+ error_report("couldn't create PCI controller");
exit(1);
}
@@ -270,8 +271,7 @@ static void bamboo_init(MachineState *machine)
}
/* XXX try again as binary */
if (success < 0) {
- fprintf(stderr, "qemu: could not load kernel '%s'\n",
- kernel_filename);
+ error_report("could not load kernel '%s'", kernel_filename);
exit(1);
}
}
@@ -282,8 +282,8 @@ static void bamboo_init(MachineState *machine)
ram_size - RAMDISK_ADDR);
if (initrd_size < 0) {
- fprintf(stderr, "qemu: could not load ram disk '%s' at %x\n",
- initrd_filename, RAMDISK_ADDR);
+ error_report("could not load ram disk '%s' at %x",
+ initrd_filename, RAMDISK_ADDR);
exit(1);
}
}
@@ -292,7 +292,7 @@ static void bamboo_init(MachineState *machine)
if (kernel_filename) {
if (bamboo_load_device_tree(FDT_ADDR, ram_size, RAMDISK_ADDR,
initrd_size, kernel_cmdline) < 0) {
- fprintf(stderr, "couldn't load device tree\n");
+ error_report("couldn't load device tree");
exit(1);
}
}