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>,
	Marcel Apfelbaum <marcel@redhat.com>
Subject: [Qemu-devel] [PATCH 23/26] core: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
Date: Fri, 16 Sep 2016 15:56:14 +0200	[thread overview]
Message-ID: <1474034177-17663-24-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: Marcel Apfelbaum <marcel@redhat.com>
---
 hw/core/machine.c      |  2 +-
 hw/core/platform-bus.c |  4 ++--
 hw/core/qdev.c         |  2 +-
 numa.c                 | 12 ++++++------
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 00fbe3e..3eeb1cc 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -336,7 +336,7 @@ static int error_on_sysbus_device(SysBusDevice *sbdev, void *opaque)
 {
     error_report("Option '-device %s' cannot be handled by this machine",
                  object_class_get_name(object_get_class(OBJECT(sbdev))));
-    exit(1);
+    exit(EXIT_FAILURE);
 }
 
 static void machine_init_notify(Notifier *notifier, void *data)
diff --git a/hw/core/platform-bus.c b/hw/core/platform-bus.c
index 36f84ab..03c6c17 100644
--- a/hw/core/platform-bus.c
+++ b/hw/core/platform-bus.c
@@ -122,7 +122,7 @@ static void platform_bus_map_irq(PlatformBusDevice *pbus, SysBusDevice *sbdev,
     irqn = find_first_zero_bit(pbus->used_irqs, max_irqs);
     if (irqn >= max_irqs) {
         error_report("Platform Bus: Can not fit IRQ line");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     set_bit(irqn, pbus->used_irqs);
@@ -157,7 +157,7 @@ static void platform_bus_map_mmio(PlatformBusDevice *pbus, SysBusDevice *sbdev,
     if (!found_region) {
         error_report("Platform Bus: Can not fit MMIO region of size %"PRIx64,
                      size);
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     /* Map the device's region into our Platform Bus MMIO space */
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 5783442..d6e4483 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -359,7 +359,7 @@ void qdev_init_nofail(DeviceState *dev)
     if (err) {
         error_reportf_err(err, "Initialization of device %s failed: ",
                           object_get_typename(OBJECT(dev)));
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     object_unref(OBJECT(dev));
 }
diff --git a/numa.c b/numa.c
index 6289f46..57e4fc4 100644
--- a/numa.c
+++ b/numa.c
@@ -298,7 +298,7 @@ void parse_numa_opts(MachineClass *mc)
     int i;
 
     if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, NULL, NULL)) {
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     assert(max_numa_nodeid <= MAX_NODES);
@@ -308,7 +308,7 @@ void parse_numa_opts(MachineClass *mc)
         /* Report large node IDs first, to make mistakes easier to spot */
         if (!numa_info[i].present) {
             error_report("numa: Node ID missing: %d", i);
-            exit(1);
+            exit(EXIT_FAILURE);
         }
     }
 
@@ -352,7 +352,7 @@ void parse_numa_opts(MachineClass *mc)
             error_report("total memory for NUMA nodes (0x%" PRIx64 ")"
                          " should equal RAM size (0x" RAM_ADDR_FMT ")",
                          numa_total, ram_size);
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         for (i = 0; i < nb_numa_nodes; i++) {
@@ -416,7 +416,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
         if (err) {
             error_report_err(err);
             if (mem_prealloc) {
-                exit(1);
+                exit(EXIT_FAILURE);
             }
 
             /* Legacy behavior: if allocation failed, fall back to
@@ -426,7 +426,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
         }
 #else
         fprintf(stderr, "-mem-path not supported on this host\n");
-        exit(1);
+        exit(EXIT_FAILURE);
 #endif
     } else {
         memory_region_init_ram(mr, owner, name, ram_size, &error_fatal);
@@ -461,7 +461,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
             error_report("memory backend %s is used multiple times. Each "
                          "-numa option must use a different memdev value.",
                          path);
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         host_memory_backend_set_mapped(backend, true);
-- 
2.5.5

  parent reply	other threads:[~2016-09-16 14:13 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 ` [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 ` Laurent Vivier [this message]
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-24-git-send-email-lvivier@redhat.com \
    --to=lvivier@redhat.com \
    --cc=marcel@redhat.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.