aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Cox <jkc@redhat.com>2014-03-19 14:06:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-19 16:56:31 -0400
commit4cb005a93ceec3ffaf5584a27dafa9ae64944fa7 (patch)
treecd2a8e3699a96c4bdfe13f91be0f2dfdb4fb6c43
parent9f8d0e8bac8c74706b698dedd8ce307395091508 (diff)
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>
-rw-r--r--drivers/staging/unisys/include/timskmod.h7
-rw-r--r--drivers/staging/unisys/visorchipset/visorchipset_main.c50
2 files changed, 33 insertions, 24 deletions
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 */
148 msg, status); \ 148 msg, status); \
149 RETINT(status); \ 149 RETINT(status); \
150 } while (0) 150 } while (0)
151#define FAIL_WPOSTCODE_1(msg, status, EVENT_PC) do { \
152 ERRDRV("'%s'" \
153 ": error (status=%d)\n", \
154 msg, status); \
155 POSTCODE_LINUX_2(EVENT_PC, DIAG_SEVERITY_ERR); \
156 RETINT(status); \
157 } while (0)
158/** Try to evaulate the provided expression, and do a RETINT(x) iff 151/** Try to evaulate the provided expression, and do a RETINT(x) iff
159 * the expression evaluates to < 0. 152 * the expression evaluates to < 0.
160 * @param x the expression to try 153 * @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)
2695 controlvm_init(); 2695 controlvm_init();
2696 MajorDev = MKDEV(visorchipset_major, 0); 2696 MajorDev = MKDEV(visorchipset_major, 0);
2697 rc = visorchipset_file_init(MajorDev, &ControlVm_channel); 2697 rc = visorchipset_file_init(MajorDev, &ControlVm_channel);
2698 if (rc < 0) 2698 if (rc < 0) {
2699 FAIL_WPOSTCODE_1("visorchipset_file_init(MajorDev, &ControlVm_channel)", 2699 ERRDRV("visorchipset_file_init(MajorDev, &ControlVm_channel): error (status=%d)\n", rc);
2700 rc, CHIPSET_INIT_FAILURE_PC); 2700 POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
2701 goto Away;
2702 }
2701 2703
2702 proc_Init(); 2704 proc_Init();
2703 memset(PartitionPropertyNames, 0, sizeof(PartitionPropertyNames)); 2705 memset(PartitionPropertyNames, 0, sizeof(PartitionPropertyNames));
@@ -2738,16 +2740,20 @@ visorchipset_init(void)
2738 memset(&g_DelDumpMsgHdr, 0, sizeof(CONTROLVM_MESSAGE_HEADER)); 2740 memset(&g_DelDumpMsgHdr, 0, sizeof(CONTROLVM_MESSAGE_HEADER));
2739 2741
2740 if (filexfer_constructor(sizeof(struct putfile_request)) < 0) { 2742 if (filexfer_constructor(sizeof(struct putfile_request)) < 0) {
2741 FAIL_WPOSTCODE_1("filexfer_constructor failed", -1, 2743 ERRDRV("filexfer_constructor failed: (status=-1)\n");
2742 CHIPSET_INIT_FAILURE_PC); 2744 POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
2745 rc = -1;
2746 goto Away;
2743 } 2747 }
2744 Putfile_buffer_list_pool = 2748 Putfile_buffer_list_pool =
2745 kmem_cache_create(Putfile_buffer_list_pool_name, 2749 kmem_cache_create(Putfile_buffer_list_pool_name,
2746 sizeof(struct putfile_buffer_entry), 2750 sizeof(struct putfile_buffer_entry),
2747 0, SLAB_HWCACHE_ALIGN, NULL); 2751 0, SLAB_HWCACHE_ALIGN, NULL);
2748 if (!Putfile_buffer_list_pool) { 2752 if (!Putfile_buffer_list_pool) {
2749 FAIL_WPOSTCODE_1("failed to alloc Putfile_buffer_list_pool", -1, 2753 ERRDRV("failed to alloc Putfile_buffer_list_pool: (status=-1)\n");
2750 CHIPSET_INIT_FAILURE_PC); 2754 POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
2755 rc = -1;
2756 goto Away;
2751 } 2757 }
2752 if (visorchipset_disable_controlvm) { 2758 if (visorchipset_disable_controlvm) {
2753 LOGINF("visorchipset_init:controlvm disabled"); 2759 LOGINF("visorchipset_init:controlvm disabled");
@@ -2762,24 +2768,34 @@ visorchipset_init(void)
2762 Periodic_controlvm_workqueue = 2768 Periodic_controlvm_workqueue =
2763 create_singlethread_workqueue("visorchipset_controlvm"); 2769 create_singlethread_workqueue("visorchipset_controlvm");
2764 2770
2765 if (Periodic_controlvm_workqueue == NULL) 2771 if (Periodic_controlvm_workqueue == NULL) {
2766 FAIL_WPOSTCODE_1("cannot create controlvm workqueue", 2772 ERRDRV("cannot create controlvm workqueue: (status=%d)\n",
2767 -ENOMEM, CREATE_WORKQUEUE_FAILED_PC); 2773 -ENOMEM);
2774 POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
2775 DIAG_SEVERITY_ERR);
2776 rc = -ENOMEM;
2777 goto Away;
2778 }
2768 Most_recent_message_jiffies = jiffies; 2779 Most_recent_message_jiffies = jiffies;
2769 Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST; 2780 Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
2770 rc = queue_delayed_work(Periodic_controlvm_workqueue, 2781 rc = queue_delayed_work(Periodic_controlvm_workqueue,
2771 &Periodic_controlvm_work, Poll_jiffies); 2782 &Periodic_controlvm_work, Poll_jiffies);
2772 if (rc < 0) 2783 if (rc < 0) {
2773 FAIL_WPOSTCODE_1("queue_delayed_work(Periodic_controlvm_workqueue, &Periodic_controlvm_work, Poll_jiffies);", 2784 ERRDRV("queue_delayed_work(Periodic_controlvm_workqueue, &Periodic_controlvm_work, Poll_jiffies): error (status=%d)\n", rc);
2774 rc, QUEUE_DELAYED_WORK_PC); 2785 POSTCODE_LINUX_2(QUEUE_DELAYED_WORK_PC,
2786 DIAG_SEVERITY_ERR);
2787 goto Away;
2788 }
2775 2789
2776 } 2790 }
2777 2791
2778 Visorchipset_platform_device.dev.devt = MajorDev; 2792 Visorchipset_platform_device.dev.devt = MajorDev;
2779 if (platform_device_register(&Visorchipset_platform_device) < 0) 2793 if (platform_device_register(&Visorchipset_platform_device) < 0) {
2780 FAIL_WPOSTCODE_1 2794 ERRDRV("platform_device_register(visorchipset) failed: (status=-1)\n");
2781 ("platform_device_register(visorchipset) failed", -1, 2795 POSTCODE_LINUX_2(DEVICE_REGISTER_FAILURE_PC, DIAG_SEVERITY_ERR);
2782 DEVICE_REGISTER_FAILURE_PC); 2796 rc = -1;
2797 goto Away;
2798 }
2783 LOGINF("visorchipset device created"); 2799 LOGINF("visorchipset device created");
2784 POSTCODE_LINUX_2(CHIPSET_INIT_SUCCESS_PC, POSTCODE_SEVERITY_INFO); 2800 POSTCODE_LINUX_2(CHIPSET_INIT_SUCCESS_PC, POSTCODE_SEVERITY_INFO);
2785 RETINT(0); 2801 RETINT(0);