@@ -130,7 +130,7 @@ static void leon3_generic_hw_init(MachineState *machine)
cpu = cpu_sparc_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env = &cpu->env;
@@ -152,7 +152,7 @@ static void leon3_generic_hw_init(MachineState *machine)
fprintf(stderr,
"qemu: Too much memory for this machine: %d, maximum 1G\n",
(unsigned int)(ram_size / (1024 * 1024)));
- exit(1);
+ exit(EXIT_FAILURE);
}
memory_region_allocate_system_memory(ram, NULL, "leon3.ram", ram_size);
@@ -180,18 +180,18 @@ static void leon3_generic_hw_init(MachineState *machine)
if (bios_size > prom_size) {
fprintf(stderr, "qemu: could not load prom '%s': file too big\n",
filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (bios_size > 0) {
ret = load_image_targphys(filename, 0x00000000, bios_size);
if (ret < 0 || ret > prom_size) {
fprintf(stderr, "qemu: could not load prom '%s'\n", filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
} else if (kernel_filename == NULL && !qtest_enabled()) {
fprintf(stderr, "Can't read bios image %s\n", filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
g_free(filename);
@@ -205,7 +205,7 @@ static void leon3_generic_hw_init(MachineState *machine)
if (kernel_size < 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
kernel_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (bios_size <= 0) {
/* If there is no bios/monitor, start the application. */
@@ -295,7 +295,7 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename,
if (kernel_size < 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
kernel_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* load initrd */
@@ -307,7 +307,7 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename,
if (initrd_size < 0) {
fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (initrd_size > 0) {
@@ -737,7 +737,7 @@ static void prom_init(hwaddr addr, const char *bios_name)
}
if (ret < 0 || ret > PROM_SIZE_MAX) {
fprintf(stderr, "qemu: could not load prom '%s'\n", bios_name);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -807,7 +807,7 @@ static void ram_init(hwaddr addr, ram_addr_t RAM_size,
"qemu: Too much memory for this machine: %d, maximum %d\n",
(unsigned int)(RAM_size / (1024 * 1024)),
(unsigned int)(max_mem / (1024 * 1024)));
- exit(1);
+ exit(EXIT_FAILURE);
}
dev = qdev_create(NULL, "memory");
s = SYS_BUS_DEVICE(dev);
@@ -850,7 +850,7 @@ static void cpu_devinit(const char *cpu_model, unsigned int id,
cpu = cpu_sparc_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env = &cpu->env;
@@ -944,21 +944,21 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
if (graphic_depth != 8 && graphic_depth != 24) {
error_report("Unsupported depth: %d", graphic_depth);
- exit (1);
+ exit(EXIT_FAILURE);
}
num_vsimms = 0;
if (num_vsimms == 0) {
if (vga_interface_type == VGA_CG3) {
if (graphic_depth != 8) {
error_report("Unsupported depth: %d", graphic_depth);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (!(graphic_width == 1024 && graphic_height == 768) &&
!(graphic_width == 1152 && graphic_height == 900)) {
error_report("Unsupported resolution: %d x %d", graphic_width,
graphic_height);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* sbus irq 5 */
@@ -968,13 +968,13 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
/* If no display specified, default to TCX */
if (graphic_depth != 8 && graphic_depth != 24) {
error_report("Unsupported depth: %d", graphic_depth);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (!(graphic_width == 1024 && graphic_height == 768)) {
error_report("Unsupported resolution: %d x %d",
graphic_width, graphic_height);
- exit(1);
+ exit(EXIT_FAILURE);
}
tcx_init(hwdef->tcx_base, slavio_irq[11], 0x00100000,
@@ -1025,7 +1025,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
if (drive_get_max_bus(IF_SCSI) > 0) {
fprintf(stderr, "qemu: too many SCSI bus\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
esp_init(hwdef->esp_base, 2,
@@ -207,7 +207,7 @@ static uint64_t sun4u_load_kernel(const char *kernel_filename,
if (kernel_size < 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
kernel_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* load initrd above kernel */
*initrd_size = 0;
@@ -220,7 +220,7 @@ static uint64_t sun4u_load_kernel(const char *kernel_filename,
if ((int)*initrd_size < 0) {
fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (*initrd_size > 0) {
@@ -647,7 +647,7 @@ static void prom_init(hwaddr addr, const char *bios_name)
}
if (ret < 0 || ret > PROM_SIZE_MAX) {
fprintf(stderr, "qemu: could not load prom '%s'\n", bios_name);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -760,7 +760,7 @@ static SPARCCPU *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef)
cpu = cpu_sparc_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find Sparc CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env = &cpu->env;
This patch is the result of coccinelle script scripts/coccinelle/exit.cocci Signed-off-by: Laurent Vivier <lvivier@redhat.com> CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> --- hw/sparc/leon3.c | 12 ++++++------ hw/sparc/sun4m.c | 22 +++++++++++----------- hw/sparc64/sun4u.c | 8 ++++---- 3 files changed, 21 insertions(+), 21 deletions(-)