Staging: unisys: Remove FAIL_WPOSTCODE_1 macro

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>
This commit is contained in:
Ken Cox 2014-03-19 13:06:20 -05:00 committed by Greg Kroah-Hartman
parent 9f8d0e8bac
commit 4cb005a93c
2 changed files with 33 additions and 24 deletions

View 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

View 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);