This patch is the result of coccinelle script
scripts/coccinelle/exit.cocci

Signed-off-by: Laurent Vivier <lviv...@redhat.com>
CC: Marcel Apfelbaum <mar...@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


Reply via email to