qemu-devel.nongnu.org archive mirror
 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>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Subject: [Qemu-devel] [PATCH 12/26] sparc: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
Date: Fri, 16 Sep 2016 15:56:03 +0200	[thread overview]
Message-ID: <1474034177-17663-13-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: 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(-)

diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index 6e16478..9cc5b94 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -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.  */
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 478fda8..d3d6bd5 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -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,
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 3165e18..5ed72e5 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -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;
 
-- 
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 ` Laurent Vivier [this message]
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 ` [Qemu-devel] [PATCH 15/26] mips: " Laurent Vivier
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-13-git-send-email-lvivier@redhat.com \
    --to=lvivier@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).