All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: qemu-trivial@nongnu.org
Cc: qemu-devel@nongnu.org, Laurent Vivier <lvivier@redhat.com>,
	Leon Alrae <leon.alrae@imgtec.com>
Subject: [Qemu-devel] [PATCH 15/26] mips: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
Date: Fri, 16 Sep 2016 15:56:06 +0200	[thread overview]
Message-ID: <1474034177-17663-16-git-send-email-lvivier@redhat.com> (raw)
In-Reply-To: <1474034177-17663-1-git-send-email-lvivier@redhat.com>

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(-)

diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 889cdc7..24adc46 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -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 */
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 73f6c9f..6c4b423 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -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);
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index e90857e..c7baa51 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -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,
diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index 1b91195..d9dc5fa 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -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;
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 16a59c7..fd5808e 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -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);
 
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 1999ece..19ae58f 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -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",
-- 
2.5.5

  parent reply	other threads:[~2016-09-16 13:58 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 13:55 [Qemu-devel] [PATCH 00/26] trivial: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE) Laurent Vivier
2016-09-16 13:55 ` [Qemu-devel] [PATCH 01/26] coccinelle: " Laurent Vivier
2016-09-16 15:35   ` Eric Blake
2016-09-16 13:55 ` [Qemu-devel] [PATCH 02/26] arm: " Laurent Vivier
2016-09-16 13:55 ` [Qemu-devel] [PATCH 03/26] cris: " Laurent Vivier
2016-09-16 14:41   ` Edgar E. Iglesias
2016-09-16 13:55 ` [Qemu-devel] [PATCH 04/26] block: " Laurent Vivier
2016-09-16 13:55 ` [Qemu-devel] [PATCH 05/26] ppc: " Laurent Vivier
2016-09-19  5:22   ` David Gibson
2016-09-16 13:55 ` [Qemu-devel] [PATCH 06/26] graphics: " Laurent Vivier
2016-09-16 13:55 ` [Qemu-devel] [PATCH 07/26] tests: " Laurent Vivier
2016-09-16 13:55 ` [Qemu-devel] [PATCH 08/26] replay: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 09/26] qemu-user: " Laurent Vivier
2016-09-21 19:21   ` Riku Voipio
2016-09-16 13:56 ` [Qemu-devel] [PATCH 10/26] m68k: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 11/26] pci, virtio: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 12/26] sparc: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 13/26] sh4: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 14/26] x86: " Laurent Vivier
2016-09-16 13:56 ` Laurent Vivier [this message]
2016-09-16 13:56 ` [Qemu-devel] [PATCH 16/26] s390: " Laurent Vivier
2016-09-19 11:07   ` Cornelia Huck
2016-09-16 13:56 ` [Qemu-devel] [PATCH 17/26] tcg: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 18/26] posix: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 19/26] alpha: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 20/26] common: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 21/26] misc machine: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 22/26] blockdev: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 23/26] core: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 24/26] error, trace: " Laurent Vivier
2016-09-16 15:55   ` Eric Blake
2016-09-16 13:56 ` [Qemu-devel] [PATCH 25/26] hw: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-devel] [PATCH 26/26] net: " Laurent Vivier
2016-09-16 14:41 ` [Qemu-devel] [PATCH 00/26] trivial: " no-reply
2016-09-16 14:47 ` Peter Maydell
2016-09-16 15:39   ` Daniel P. Berrange
2016-09-16 15:45     ` Peter Maydell
2016-09-19  9:21       ` Markus Armbruster
2016-09-19  9:46       ` Laurent Vivier
2016-09-19 10:19         ` Peter Maydell
2016-09-19 10:32       ` Cornelia Huck
2016-09-16 15:27 ` Daniel P. Berrange
2016-09-16 15:39   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474034177-17663-16-git-send-email-lvivier@redhat.com \
    --to=lvivier@redhat.com \
    --cc=leon.alrae@imgtec.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.