From: Ken Cox Date: Wed, 19 Mar 2014 18:06:20 +0000 (-0500) Subject: Staging: unisys: Remove FAIL_WPOSTCODE_1 macro X-Git-Tag: MMI-PSA29.97-13-9~12500^2~12 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4cb005a93ceec3ffaf5584a27dafa9ae64944fa7;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h index 413a3673772d..6abb32ebca47 100644 --- a/drivers/staging/unisys/include/timskmod.h +++ b/drivers/staging/unisys/include/timskmod.h @@ -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 diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c index b0f97db2645e..b769257d3aa8 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c @@ -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);