Staging: unisys: Remove RETBOOL macro
authorKen Cox <jkc@redhat.com>
Wed, 19 Mar 2014 18:06:21 +0000 (13:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Mar 2014 20:56:31 +0000 (13:56 -0700)
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>
drivers/staging/unisys/include/timskmod.h
drivers/staging/unisys/uislib/uisqueue.c
drivers/staging/unisys/visorchannel/visorchannel_funcs.c
drivers/staging/unisys/visorutil/periodic_work.c

index 6abb32ebca473d567aa4a586b6d26f7ce4b0f4a3..0623f55ec764a2d7ccd78dcd6d78568d09de1e8d 100644 (file)
@@ -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"
index a7a8b2ed55cb15fc2d9c796d53250c84e909164a..7ea306e52ba8db166a9dbcd9e9b805cbf0d09cfa 100644 (file)
@@ -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
 
index f397d8307c5d605aa8fba06c61f8855cfcf0e24d..ff4556b5926265a230f84b2368ae4bd72d13b886 100644 (file)
@@ -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);
index fb1e894ebdc14b2b8f52d99ebacb3d6134193cbc..0670a3174682eecedf78379becd32e2f7200c9f6 100644 (file)
@@ -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;