@@ -121,7 +121,7 @@ static int64_t load_kernel (CPUMIPSState *env)
(uint64_t *)&kernel_high, 0, EM_MIPS, 1, 0) < 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
loaderparams.kernel_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* load initrd */
@@ -135,7 +135,7 @@ static int64_t load_kernel (CPUMIPSState *env)
fprintf(stderr,
"qemu: memory too small for initial ram disk '%s'\n",
loaderparams.initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
initrd_size = load_image_targphys(loaderparams.initrd_filename,
initrd_offset, ram_size - initrd_offset);
@@ -143,7 +143,7 @@ static int64_t load_kernel (CPUMIPSState *env)
if (initrd_size == (target_ulong) -1) {
fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
loaderparams.initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -281,7 +281,7 @@ static void mips_fulong2e_init(MachineState *machine)
cpu = cpu_mips_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env = &cpu->env;
@@ -329,7 +329,7 @@ static void mips_fulong2e_init(MachineState *machine)
if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
!kernel_filename && !qtest_enabled()) {
error_report("Could not load MIPS bios '%s'", bios_name);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -346,7 +346,7 @@ static void mips_fulong2e_init(MachineState *machine)
isa_bus = vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 0));
if (!isa_bus) {
fprintf(stderr, "vt82c686b_init error\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Interrupt controller */
@@ -154,7 +154,7 @@ static void mips_jazz_init(MachineState *machine,
cpu = cpu_mips_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env = &cpu->env;
qemu_register_reset(main_cpu_reset, cpu);
@@ -197,7 +197,7 @@ static void mips_jazz_init(MachineState *machine,
}
if ((bios_size < 0 || bios_size > MAGNUM_BIOS_SIZE) && !qtest_enabled()) {
error_report("Could not load MIPS bios '%s'", bios_name);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Init CPU internal devices */
@@ -278,10 +278,10 @@ static void mips_jazz_init(MachineState *machine,
break;
} else if (is_help_option(nd->model)) {
fprintf(stderr, "qemu: Supported NICs: dp83932\n");
- exit(1);
+ exit(EXIT_FAILURE);
} else {
fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -293,7 +293,7 @@ static void mips_jazz_init(MachineState *machine,
/* Floppy */
if (drive_get_max_bus(IF_FLOPPY) >= MAX_FD) {
fprintf(stderr, "qemu: too many floppy drives\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
for (n = 0; n < MAX_FD; n++) {
fds[n] = drive_get(IF_FLOPPY, 0, n);
@@ -803,7 +803,7 @@ static int64_t load_kernel (void)
big_endian, EM_MIPS, 1, 0) < 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
loaderparams.kernel_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Sanity check where the kernel has been linked */
@@ -811,7 +811,7 @@ static int64_t load_kernel (void)
if (kernel_entry & 0x80000000ll) {
error_report("KVM guest kernels must be linked in useg. "
"Did you forget to enable CONFIG_KVM_GUEST?");
- exit(1);
+ exit(EXIT_FAILURE);
}
xlate_to_kseg0 = cpu_mips_kvm_um_phys_to_kseg0;
@@ -819,7 +819,7 @@ static int64_t load_kernel (void)
if (!(kernel_entry & 0x80000000ll)) {
error_report("KVM guest kernels aren't supported with TCG. "
"Did you unintentionally enable CONFIG_KVM_GUEST?");
- exit(1);
+ exit(EXIT_FAILURE);
}
xlate_to_kseg0 = cpu_mips_phys_to_kseg0;
@@ -836,7 +836,7 @@ static int64_t load_kernel (void)
fprintf(stderr,
"qemu: memory too small for initial ram disk '%s'\n",
loaderparams.initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
initrd_size = load_image_targphys(loaderparams.initrd_filename,
initrd_offset,
@@ -845,7 +845,7 @@ static int64_t load_kernel (void)
if (initrd_size == (target_ulong) -1) {
fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
loaderparams.initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -921,7 +921,7 @@ static void create_cpu_without_cps(const char *cpu_model,
cpu = cpu_mips_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Init internal devices */
@@ -950,7 +950,7 @@ static void create_cps(MaltaState *s, const char *cpu_model,
object_property_set_bool(OBJECT(s->cps), true, "realized", &err);
if (err != NULL) {
error_report("%s", error_get_pretty(err));
- exit(1);
+ exit(EXIT_FAILURE);
}
sysbus_mmio_map_overlap(SYS_BUS_DEVICE(s->cps), 0, 0, 1);
@@ -1037,7 +1037,7 @@ void mips_malta_init(MachineState *machine)
fprintf(stderr,
"qemu: Too much memory for this machine: %d MB, maximum 2048 MB\n",
((unsigned int)ram_size / (1 << 20)));
- exit(1);
+ exit(EXIT_FAILURE);
}
/* register RAM at high address where it is undisturbed by IO */
@@ -1121,7 +1121,7 @@ void mips_malta_init(MachineState *machine)
if (kvm_enabled()) {
error_report("KVM enabled but no -kernel argument was specified. "
"Booting from flash is not supported with KVM.");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Load firmware from flash. */
if (!dinfo) {
@@ -1141,7 +1141,7 @@ void mips_malta_init(MachineState *machine)
!kernel_filename && !qtest_enabled()) {
error_report("Could not load MIPS bios '%s', and no "
"-kernel argument was specified", bios_name);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
/* In little endian mode the 32bit words in the bios are swapped,
@@ -80,7 +80,7 @@ static int64_t load_kernel(void)
} else {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
loaderparams.kernel_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* load initrd */
@@ -94,7 +94,7 @@ static int64_t load_kernel(void)
fprintf(stderr,
"qemu: memory too small for initial ram disk '%s'\n",
loaderparams.initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
initrd_size = load_image_targphys(loaderparams.initrd_filename,
initrd_offset, loaderparams.ram_size - initrd_offset);
@@ -102,7 +102,7 @@ static int64_t load_kernel(void)
if (initrd_size == (target_ulong) -1) {
fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
loaderparams.initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
return entry;
@@ -165,7 +165,7 @@ mips_mipssim_init(MachineState *machine)
cpu = cpu_mips_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env = &cpu->env;
@@ -201,7 +201,7 @@ mips_mipssim_init(MachineState *machine)
/* Bail out if we have neither a kernel image nor boot vector code. */
error_report("Could not load MIPS bios '%s', and no "
"-kernel argument was specified", bios_name);
- exit(1);
+ exit(EXIT_FAILURE);
} else {
/* We have a boot vector start address. */
env->active_tc.PC = (target_long)(int32_t)0xbfc00000;
@@ -98,7 +98,7 @@ static int64_t load_kernel(void)
} else {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
loaderparams.kernel_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* load initrd */
@@ -112,7 +112,7 @@ static int64_t load_kernel(void)
fprintf(stderr,
"qemu: memory too small for initial ram disk '%s'\n",
loaderparams.initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
initrd_size = load_image_targphys(loaderparams.initrd_filename,
initrd_offset,
@@ -121,7 +121,7 @@ static int64_t load_kernel(void)
if (initrd_size == (target_ulong) -1) {
fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
loaderparams.initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -194,7 +194,7 @@ void mips_r4k_init(MachineState *machine)
cpu = cpu_mips_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env = &cpu->env;
@@ -208,7 +208,7 @@ void mips_r4k_init(MachineState *machine)
fprintf(stderr,
"qemu: Too much memory for this machine: %d MB, maximum 256 MB\n",
((unsigned int)ram_size / (1 << 20)));
- exit(1);
+ exit(EXIT_FAILURE);
}
memory_region_allocate_system_memory(ram, NULL, "mips_r4k.ram", ram_size);
@@ -451,7 +451,7 @@ static uint32_t bonito_sbridge_pciaddr(void *opaque, hwaddr addr)
if (idsel == 0) {
fprintf(stderr, "error in bonito pci config address " TARGET_FMT_plx
",pcimap_cfg=%x\n", addr, s->regs[BONITO_PCIMAP_CFG]);
- exit(1);
+ exit(EXIT_FAILURE);
}
pciaddr = PCI_ADDR(pci_bus_num(phb->bus), devno, funno, regno);
DPRINTF("cfgaddr %x pciaddr %x busno %x devno %d funno %d regno %d\n",
This patch is the result of coccinelle script scripts/coccinelle/exit.cocci Signed-off-by: Laurent Vivier <lvivier@redhat.com> CC: Leon Alrae <leon.alrae@imgtec.com> --- hw/mips/mips_fulong2e.c | 12 ++++++------ hw/mips/mips_jazz.c | 10 +++++----- hw/mips/mips_malta.c | 20 ++++++++++---------- hw/mips/mips_mipssim.c | 10 +++++----- hw/mips/mips_r4k.c | 10 +++++----- hw/pci-host/bonito.c | 2 +- 6 files changed, 32 insertions(+), 32 deletions(-)