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>
This commit is contained in:
parent
4cb005a93c
commit
61e03b433d
@ -132,10 +132,6 @@ typedef long VMMIO32;/**< #VMMIO pointing to 32-bit data */
|
||||
* @param x the value to return
|
||||
*/
|
||||
#define RETPTR(x) do { rc = (x); RETTRACE(x); goto Away; } while (0)
|
||||
/** return from a BOOL function, using a common exit point "Away"
|
||||
* @param x the value to return
|
||||
*/
|
||||
#define RETBOOL(x) do { rc = (x); RETTRACE(x); goto Away; } while (0)
|
||||
/** Given a typedef/struct/union and a member field name,
|
||||
* return the number of bytes occupied by that field.
|
||||
* @param TYPE the typedef name, or "struct xx" or "union xx"
|
||||
|
@ -31,7 +31,6 @@
|
||||
#define RETVOID do { goto Away; } while (0)
|
||||
#define RETINT(x) do { rc = (x); goto Away; } while (0)
|
||||
#define RETPTR(x) do { rc = (x); goto Away; } while (0)
|
||||
#define RETBOOL(x) do { rc = (x); goto Away; } while (0)
|
||||
|
||||
#define CHECK_CACHE_ALIGN 0
|
||||
|
||||
|
@ -313,7 +313,7 @@ sig_read_header(VISORCHANNEL *channel, U32 queue,
|
||||
queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue));
|
||||
FAIL("visor_memregion_read of signal queue failed", FALSE);
|
||||
}
|
||||
RETBOOL(TRUE);
|
||||
rc = TRUE;
|
||||
Away:
|
||||
return rc;
|
||||
}
|
||||
@ -337,7 +337,7 @@ sig_do_data(VISORCHANNEL *channel, U32 queue,
|
||||
FAIL("visor_memregion_read of signal data failed",
|
||||
FALSE);
|
||||
}
|
||||
RETBOOL(TRUE);
|
||||
rc = TRUE;
|
||||
Away:
|
||||
return rc;
|
||||
}
|
||||
@ -387,10 +387,14 @@ visorchannel_signalremove(VISORCHANNEL *channel, U32 queue, void *msg)
|
||||
if (channel->needs_lock)
|
||||
spin_lock(&channel->remove_lock);
|
||||
|
||||
if (!sig_read_header(channel, queue, &sig_hdr))
|
||||
RETBOOL(FALSE);
|
||||
if (sig_hdr.Head == sig_hdr.Tail)
|
||||
RETBOOL(FALSE); /* no signals to remove */
|
||||
if (!sig_read_header(channel, queue, &sig_hdr)) {
|
||||
rc = FALSE;
|
||||
goto Away;
|
||||
}
|
||||
if (sig_hdr.Head == sig_hdr.Tail) {
|
||||
rc = FALSE; /* no signals to remove */
|
||||
goto Away;
|
||||
}
|
||||
sig_hdr.Tail = (sig_hdr.Tail + 1) % sig_hdr.MaxSignalSlots;
|
||||
if (!sig_read_data(channel, queue, &sig_hdr, sig_hdr.Tail, msg))
|
||||
FAIL("sig_read_data failed", FALSE);
|
||||
@ -405,9 +409,7 @@ visorchannel_signalremove(VISORCHANNEL *channel, U32 queue, void *msg)
|
||||
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsReceived))
|
||||
FAIL("visor_memregion_write of NumSignalsReceived failed",
|
||||
FALSE);
|
||||
|
||||
RETBOOL(TRUE);
|
||||
|
||||
rc = TRUE;
|
||||
Away:
|
||||
if (channel->needs_lock)
|
||||
spin_unlock(&channel->remove_lock);
|
||||
@ -425,20 +427,19 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
|
||||
if (channel->needs_lock)
|
||||
spin_lock(&channel->insert_lock);
|
||||
|
||||
if (!sig_read_header(channel, queue, &sig_hdr))
|
||||
RETBOOL(FALSE);
|
||||
if (!sig_read_header(channel, queue, &sig_hdr)) {
|
||||
rc = FALSE;
|
||||
goto Away;
|
||||
}
|
||||
|
||||
sig_hdr.Head = ((sig_hdr.Head + 1) % sig_hdr.MaxSignalSlots);
|
||||
if (sig_hdr.Head == sig_hdr.Tail) {
|
||||
#if 0
|
||||
ERRDRV("visorchannel queue #%d overflow (max slots=%d)",
|
||||
queue, sig_hdr.MaxSignalSlots);
|
||||
#endif
|
||||
sig_hdr.NumOverflows++;
|
||||
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumOverflows))
|
||||
FAIL("visor_memregion_write of NumOverflows failed",
|
||||
FALSE);
|
||||
RETBOOL(FALSE);
|
||||
rc = FALSE;
|
||||
goto Away;
|
||||
}
|
||||
|
||||
if (!sig_write_data(channel, queue, &sig_hdr, sig_hdr.Head, msg))
|
||||
@ -453,9 +454,7 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
|
||||
FAIL("visor_memregion_write of Head failed", FALSE);
|
||||
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsSent))
|
||||
FAIL("visor_memregion_write of NumSignalsSent failed", FALSE);
|
||||
|
||||
RETBOOL(TRUE);
|
||||
|
||||
rc = TRUE;
|
||||
Away:
|
||||
if (channel->needs_lock)
|
||||
spin_unlock(&channel->insert_lock);
|
||||
|
@ -96,15 +96,17 @@ BOOL visor_periodic_work_nextperiod(PERIODIC_WORK *periodic_work)
|
||||
if (periodic_work->want_to_stop) {
|
||||
periodic_work->is_scheduled = FALSE;
|
||||
periodic_work->want_to_stop = FALSE;
|
||||
RETBOOL(TRUE); /* yes, TRUE; see visor_periodic_work_stop() */
|
||||
rc = TRUE; /* yes, TRUE; see visor_periodic_work_stop() */
|
||||
goto Away;
|
||||
} else if (queue_delayed_work(periodic_work->workqueue,
|
||||
&periodic_work->work,
|
||||
periodic_work->jiffy_interval) < 0) {
|
||||
ERRDEV(periodic_work->devnam, "queue_delayed_work failed!");
|
||||
periodic_work->is_scheduled = FALSE;
|
||||
RETBOOL(FALSE);
|
||||
rc = FALSE;
|
||||
goto Away;
|
||||
}
|
||||
RETBOOL(TRUE);
|
||||
rc = TRUE;
|
||||
Away:
|
||||
write_unlock(&periodic_work->lock);
|
||||
return rc;
|
||||
@ -122,12 +124,15 @@ BOOL visor_periodic_work_start(PERIODIC_WORK *periodic_work)
|
||||
BOOL rc = FALSE;
|
||||
|
||||
write_lock(&periodic_work->lock);
|
||||
if (periodic_work->is_scheduled)
|
||||
RETBOOL(FALSE);
|
||||
if (periodic_work->is_scheduled) {
|
||||
rc = FALSE;
|
||||
goto Away;
|
||||
}
|
||||
if (periodic_work->want_to_stop) {
|
||||
ERRDEV(periodic_work->devnam,
|
||||
"dev_start_periodic_work failed!");
|
||||
RETBOOL(FALSE);
|
||||
rc = FALSE;
|
||||
goto Away;
|
||||
}
|
||||
INIT_DELAYED_WORK(&periodic_work->work, &periodic_work_func);
|
||||
if (queue_delayed_work(periodic_work->workqueue,
|
||||
@ -135,10 +140,11 @@ BOOL visor_periodic_work_start(PERIODIC_WORK *periodic_work)
|
||||
periodic_work->jiffy_interval) < 0) {
|
||||
ERRDEV(periodic_work->devnam,
|
||||
"%s queue_delayed_work failed!", __func__);
|
||||
RETBOOL(FALSE);
|
||||
rc = FALSE;
|
||||
goto Away;
|
||||
}
|
||||
periodic_work->is_scheduled = TRUE;
|
||||
RETBOOL(TRUE);
|
||||
rc = TRUE;
|
||||
Away:
|
||||
write_unlock(&periodic_work->lock);
|
||||
return rc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user