aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Cox <jkc@redhat.com>2014-03-19 14:06:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-19 16:56:31 -0400
commit61e03b433d22d9473432e6427c505db986d4681d (patch)
treeacfd732b127849e9a6664c8a3d16836a90f0403c
parent4cb005a93ceec3ffaf5584a27dafa9ae64944fa7 (diff)
Staging: unisys: Remove RETBOOL macro
The RETBOOL macro contained a goto statement which is not allowed in the kernel. 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.h4
-rw-r--r--drivers/staging/unisys/uislib/uisqueue.c1
-rw-r--r--drivers/staging/unisys/visorchannel/visorchannel_funcs.c37
-rw-r--r--drivers/staging/unisys/visorutil/periodic_work.c22
4 files changed, 32 insertions, 32 deletions
diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h
index 6abb32ebca47..0623f55ec764 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -132,10 +132,6 @@ typedef long VMMIO32;/**< #VMMIO pointing to 32-bit data */
132 * @param x the value to return 132 * @param x the value to return
133 */ 133 */
134#define RETPTR(x) do { rc = (x); RETTRACE(x); goto Away; } while (0) 134#define RETPTR(x) do { rc = (x); RETTRACE(x); goto Away; } while (0)
135/** return from a BOOL function, using a common exit point "Away"
136 * @param x the value to return
137 */
138#define RETBOOL(x) do { rc = (x); RETTRACE(x); goto Away; } while (0)
139/** Given a typedef/struct/union and a member field name, 135/** Given a typedef/struct/union and a member field name,
140 * return the number of bytes occupied by that field. 136 * return the number of bytes occupied by that field.
141 * @param TYPE the typedef name, or "struct xx" or "union xx" 137 * @param TYPE the typedef name, or "struct xx" or "union xx"
diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c
index a7a8b2ed55cb..7ea306e52ba8 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -31,7 +31,6 @@
31#define RETVOID do { goto Away; } while (0) 31#define RETVOID do { goto Away; } while (0)
32#define RETINT(x) do { rc = (x); goto Away; } while (0) 32#define RETINT(x) do { rc = (x); goto Away; } while (0)
33#define RETPTR(x) do { rc = (x); goto Away; } while (0) 33#define RETPTR(x) do { rc = (x); goto Away; } while (0)
34#define RETBOOL(x) do { rc = (x); goto Away; } while (0)
35 34
36#define CHECK_CACHE_ALIGN 0 35#define CHECK_CACHE_ALIGN 0
37 36
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index f397d8307c5d..ff4556b59262 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -313,7 +313,7 @@ sig_read_header(VISORCHANNEL *channel, U32 queue,
313 queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)); 313 queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue));
314 FAIL("visor_memregion_read of signal queue failed", FALSE); 314 FAIL("visor_memregion_read of signal queue failed", FALSE);
315 } 315 }
316 RETBOOL(TRUE); 316 rc = TRUE;
317Away: 317Away:
318 return rc; 318 return rc;
319} 319}
@@ -337,7 +337,7 @@ sig_do_data(VISORCHANNEL *channel, U32 queue,
337 FAIL("visor_memregion_read of signal data failed", 337 FAIL("visor_memregion_read of signal data failed",
338 FALSE); 338 FALSE);
339 } 339 }
340 RETBOOL(TRUE); 340 rc = TRUE;
341Away: 341Away:
342 return rc; 342 return rc;
343} 343}
@@ -387,10 +387,14 @@ visorchannel_signalremove(VISORCHANNEL *channel, U32 queue, void *msg)
387 if (channel->needs_lock) 387 if (channel->needs_lock)
388 spin_lock(&channel->remove_lock); 388 spin_lock(&channel->remove_lock);
389 389
390 if (!sig_read_header(channel, queue, &sig_hdr)) 390 if (!sig_read_header(channel, queue, &sig_hdr)) {
391 RETBOOL(FALSE); 391 rc = FALSE;
392 if (sig_hdr.Head == sig_hdr.Tail) 392 goto Away;
393 RETBOOL(FALSE); /* no signals to remove */ 393 }
394 if (sig_hdr.Head == sig_hdr.Tail) {
395 rc = FALSE; /* no signals to remove */
396 goto Away;
397 }
394 sig_hdr.Tail = (sig_hdr.Tail + 1) % sig_hdr.MaxSignalSlots; 398 sig_hdr.Tail = (sig_hdr.Tail + 1) % sig_hdr.MaxSignalSlots;
395 if (!sig_read_data(channel, queue, &sig_hdr, sig_hdr.Tail, msg)) 399 if (!sig_read_data(channel, queue, &sig_hdr, sig_hdr.Tail, msg))
396 FAIL("sig_read_data failed", FALSE); 400 FAIL("sig_read_data failed", FALSE);
@@ -405,9 +409,7 @@ visorchannel_signalremove(VISORCHANNEL *channel, U32 queue, void *msg)
405 if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsReceived)) 409 if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsReceived))
406 FAIL("visor_memregion_write of NumSignalsReceived failed", 410 FAIL("visor_memregion_write of NumSignalsReceived failed",
407 FALSE); 411 FALSE);
408 412 rc = TRUE;
409 RETBOOL(TRUE);
410
411Away: 413Away:
412 if (channel->needs_lock) 414 if (channel->needs_lock)
413 spin_unlock(&channel->remove_lock); 415 spin_unlock(&channel->remove_lock);
@@ -425,20 +427,19 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
425 if (channel->needs_lock) 427 if (channel->needs_lock)
426 spin_lock(&channel->insert_lock); 428 spin_lock(&channel->insert_lock);
427 429
428 if (!sig_read_header(channel, queue, &sig_hdr)) 430 if (!sig_read_header(channel, queue, &sig_hdr)) {
429 RETBOOL(FALSE); 431 rc = FALSE;
432 goto Away;
433 }
430 434
431 sig_hdr.Head = ((sig_hdr.Head + 1) % sig_hdr.MaxSignalSlots); 435 sig_hdr.Head = ((sig_hdr.Head + 1) % sig_hdr.MaxSignalSlots);
432 if (sig_hdr.Head == sig_hdr.Tail) { 436 if (sig_hdr.Head == sig_hdr.Tail) {
433#if 0
434 ERRDRV("visorchannel queue #%d overflow (max slots=%d)",
435 queue, sig_hdr.MaxSignalSlots);
436#endif
437 sig_hdr.NumOverflows++; 437 sig_hdr.NumOverflows++;
438 if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumOverflows)) 438 if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumOverflows))
439 FAIL("visor_memregion_write of NumOverflows failed", 439 FAIL("visor_memregion_write of NumOverflows failed",
440 FALSE); 440 FALSE);
441 RETBOOL(FALSE); 441 rc = FALSE;
442 goto Away;
442 } 443 }
443 444
444 if (!sig_write_data(channel, queue, &sig_hdr, sig_hdr.Head, msg)) 445 if (!sig_write_data(channel, queue, &sig_hdr, sig_hdr.Head, msg))
@@ -453,9 +454,7 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
453 FAIL("visor_memregion_write of Head failed", FALSE); 454 FAIL("visor_memregion_write of Head failed", FALSE);
454 if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsSent)) 455 if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsSent))
455 FAIL("visor_memregion_write of NumSignalsSent failed", FALSE); 456 FAIL("visor_memregion_write of NumSignalsSent failed", FALSE);
456 457 rc = TRUE;
457 RETBOOL(TRUE);
458
459Away: 458Away:
460 if (channel->needs_lock) 459 if (channel->needs_lock)
461 spin_unlock(&channel->insert_lock); 460 spin_unlock(&channel->insert_lock);
diff --git a/drivers/staging/unisys/visorutil/periodic_work.c b/drivers/staging/unisys/visorutil/periodic_work.c
index fb1e894ebdc1..0670a3174682 100644
--- a/drivers/staging/unisys/visorutil/periodic_work.c
+++ b/drivers/staging/unisys/visorutil/periodic_work.c
@@ -96,15 +96,17 @@ BOOL visor_periodic_work_nextperiod(PERIODIC_WORK *periodic_work)
96 if (periodic_work->want_to_stop) { 96 if (periodic_work->want_to_stop) {
97 periodic_work->is_scheduled = FALSE; 97 periodic_work->is_scheduled = FALSE;
98 periodic_work->want_to_stop = FALSE; 98 periodic_work->want_to_stop = FALSE;
99 RETBOOL(TRUE); /* yes, TRUE; see visor_periodic_work_stop() */ 99 rc = TRUE; /* yes, TRUE; see visor_periodic_work_stop() */
100 goto Away;
100 } else if (queue_delayed_work(periodic_work->workqueue, 101 } else if (queue_delayed_work(periodic_work->workqueue,
101 &periodic_work->work, 102 &periodic_work->work,
102 periodic_work->jiffy_interval) < 0) { 103 periodic_work->jiffy_interval) < 0) {
103 ERRDEV(periodic_work->devnam, "queue_delayed_work failed!"); 104 ERRDEV(periodic_work->devnam, "queue_delayed_work failed!");
104 periodic_work->is_scheduled = FALSE; 105 periodic_work->is_scheduled = FALSE;
105 RETBOOL(FALSE); 106 rc = FALSE;
107 goto Away;
106 } 108 }
107 RETBOOL(TRUE); 109 rc = TRUE;
108Away: 110Away:
109 write_unlock(&periodic_work->lock); 111 write_unlock(&periodic_work->lock);
110 return rc; 112 return rc;
@@ -122,12 +124,15 @@ BOOL visor_periodic_work_start(PERIODIC_WORK *periodic_work)
122 BOOL rc = FALSE; 124 BOOL rc = FALSE;
123 125
124 write_lock(&periodic_work->lock); 126 write_lock(&periodic_work->lock);
125 if (periodic_work->is_scheduled) 127 if (periodic_work->is_scheduled) {
126 RETBOOL(FALSE); 128 rc = FALSE;
129 goto Away;
130 }
127 if (periodic_work->want_to_stop) { 131 if (periodic_work->want_to_stop) {
128 ERRDEV(periodic_work->devnam, 132 ERRDEV(periodic_work->devnam,
129 "dev_start_periodic_work failed!"); 133 "dev_start_periodic_work failed!");
130 RETBOOL(FALSE); 134 rc = FALSE;
135 goto Away;
131 } 136 }
132 INIT_DELAYED_WORK(&periodic_work->work, &periodic_work_func); 137 INIT_DELAYED_WORK(&periodic_work->work, &periodic_work_func);
133 if (queue_delayed_work(periodic_work->workqueue, 138 if (queue_delayed_work(periodic_work->workqueue,
@@ -135,10 +140,11 @@ BOOL visor_periodic_work_start(PERIODIC_WORK *periodic_work)
135 periodic_work->jiffy_interval) < 0) { 140 periodic_work->jiffy_interval) < 0) {
136 ERRDEV(periodic_work->devnam, 141 ERRDEV(periodic_work->devnam,
137 "%s queue_delayed_work failed!", __func__); 142 "%s queue_delayed_work failed!", __func__);
138 RETBOOL(FALSE); 143 rc = FALSE;
144 goto Away;
139 } 145 }
140 periodic_work->is_scheduled = TRUE; 146 periodic_work->is_scheduled = TRUE;
141 RETBOOL(TRUE); 147 rc = TRUE;
142Away: 148Away:
143 write_unlock(&periodic_work->lock); 149 write_unlock(&periodic_work->lock);
144 return rc; 150 return rc;