Staging: unisys: Remove FAIL_WPOSTCODE_1 macro
authorKen Cox <jkc@redhat.com>
Wed, 19 Mar 2014 18:06:20 +0000 (13:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Mar 2014 20:56:31 +0000 (13:56 -0700)
Part of a series to get rid of goto statements embedded in macros.  I'm
breaking this up into a series of smaller patches for easier review.  The
later patches in the series will actually remove the goto statements.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/include/timskmod.h
drivers/staging/unisys/visorchipset/visorchipset_main.c

index 413a3673772de9241027d6d81de6c626b5f1d036..6abb32ebca473d567aa4a586b6d26f7ce4b0f4a3 100644 (file)
@@ -148,13 +148,6 @@ typedef long VMMIO32;/**< #VMMIO pointing to 32-bit data */
                       msg, status);                                  \
                RETINT(status);                                       \
        } while (0)
-#define FAIL_WPOSTCODE_1(msg, status, EVENT_PC) do {          \
-               ERRDRV("'%s'"                                         \
-                      ": error (status=%d)\n",                       \
-                      msg, status);                                    \
-               POSTCODE_LINUX_2(EVENT_PC, DIAG_SEVERITY_ERR);          \
-               RETINT(status);                                         \
-       } while (0)
 /** Try to evaulate the provided expression, and do a RETINT(x) iff
  *  the expression evaluates to < 0.
  *  @param x the expression to try
index b0f97db2645ef71f293afb362d41fc92b57594d0..b769257d3aa84f856709f23f8340c75a79d26cee 100644 (file)
@@ -2695,9 +2695,11 @@ visorchipset_init(void)
        controlvm_init();
        MajorDev = MKDEV(visorchipset_major, 0);
        rc = visorchipset_file_init(MajorDev, &ControlVm_channel);
-       if (rc < 0)
-               FAIL_WPOSTCODE_1("visorchipset_file_init(MajorDev, &ControlVm_channel)",
-                                rc, CHIPSET_INIT_FAILURE_PC);
+       if (rc < 0) {
+               ERRDRV("visorchipset_file_init(MajorDev, &ControlVm_channel): error (status=%d)\n", rc);
+               POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
+               goto Away;
+       }
 
        proc_Init();
        memset(PartitionPropertyNames, 0, sizeof(PartitionPropertyNames));
@@ -2738,16 +2740,20 @@ visorchipset_init(void)
        memset(&g_DelDumpMsgHdr, 0, sizeof(CONTROLVM_MESSAGE_HEADER));
 
        if (filexfer_constructor(sizeof(struct putfile_request)) < 0) {
-               FAIL_WPOSTCODE_1("filexfer_constructor failed", -1,
-                                CHIPSET_INIT_FAILURE_PC);
+               ERRDRV("filexfer_constructor failed: (status=-1)\n");
+               POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
+               rc = -1;
+               goto Away;
        }
        Putfile_buffer_list_pool =
            kmem_cache_create(Putfile_buffer_list_pool_name,
                              sizeof(struct putfile_buffer_entry),
                              0, SLAB_HWCACHE_ALIGN, NULL);
        if (!Putfile_buffer_list_pool) {
-               FAIL_WPOSTCODE_1("failed to alloc Putfile_buffer_list_pool", -1,
-                                CHIPSET_INIT_FAILURE_PC);
+               ERRDRV("failed to alloc Putfile_buffer_list_pool: (status=-1)\n");
+               POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
+               rc = -1;
+               goto Away;
        }
        if (visorchipset_disable_controlvm) {
                LOGINF("visorchipset_init:controlvm disabled");
@@ -2762,24 +2768,34 @@ visorchipset_init(void)
                Periodic_controlvm_workqueue =
                    create_singlethread_workqueue("visorchipset_controlvm");
 
-               if (Periodic_controlvm_workqueue == NULL)
-                       FAIL_WPOSTCODE_1("cannot create controlvm workqueue",
-                                        -ENOMEM, CREATE_WORKQUEUE_FAILED_PC);
+               if (Periodic_controlvm_workqueue == NULL) {
+                       ERRDRV("cannot create controlvm workqueue: (status=%d)\n",
+                              -ENOMEM);
+                       POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
+                                        DIAG_SEVERITY_ERR);
+                       rc = -ENOMEM;
+                       goto Away;
+               }
                Most_recent_message_jiffies = jiffies;
                Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
                rc = queue_delayed_work(Periodic_controlvm_workqueue,
                                        &Periodic_controlvm_work, Poll_jiffies);
-               if (rc < 0)
-                       FAIL_WPOSTCODE_1("queue_delayed_work(Periodic_controlvm_workqueue, &Periodic_controlvm_work, Poll_jiffies);",
-                                        rc, QUEUE_DELAYED_WORK_PC);
+               if (rc < 0) {
+                       ERRDRV("queue_delayed_work(Periodic_controlvm_workqueue, &Periodic_controlvm_work, Poll_jiffies): error (status=%d)\n", rc);
+                       POSTCODE_LINUX_2(QUEUE_DELAYED_WORK_PC,
+                                        DIAG_SEVERITY_ERR);
+                       goto Away;
+               }
 
        }
 
        Visorchipset_platform_device.dev.devt = MajorDev;
-       if (platform_device_register(&Visorchipset_platform_device) < 0)
-               FAIL_WPOSTCODE_1
-                   ("platform_device_register(visorchipset) failed", -1,
-                    DEVICE_REGISTER_FAILURE_PC);
+       if (platform_device_register(&Visorchipset_platform_device) < 0) {
+               ERRDRV("platform_device_register(visorchipset) failed: (status=-1)\n");
+               POSTCODE_LINUX_2(DEVICE_REGISTER_FAILURE_PC, DIAG_SEVERITY_ERR);
+               rc = -1;
+               goto Away;
+       }
        LOGINF("visorchipset device created");
        POSTCODE_LINUX_2(CHIPSET_INIT_SUCCESS_PC, POSTCODE_SEVERITY_INFO);
        RETINT(0);