]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: unisys: visorchannel: Clean up sparse warnings in visorchannel code
authorKen Cox <jkc@redhat.com>
Thu, 13 Mar 2014 20:39:21 +0000 (15:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Mar 2014 21:45:44 +0000 (14:45 -0700)
Clean up code to get rid of sparse warnings, mostly due to accessing I/O space.

Remove visorchannel_get_safe_queue(), visorchannel_safesignalremove(),
and visorchannel_safesignalinsert() since they were not called from anywhere.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorchannel/visorchannel.h
drivers/staging/unisys/visorchannel/visorchannel_funcs.c

index 45466862494c721ee95ec17271f0ed2ce879cc94..62d29a233fd05d8273fe666b214a92c3be07fcc1 100644 (file)
@@ -92,7 +92,7 @@ void *visorchannel_get_header(VISORCHANNEL *channel);
        do {                                                            \
                U8 *p = (U8 *)visorchannel_get_header(chan);            \
                if (p) {                                                \
-                       ULTRA_CHANNEL_CLIENT_TRANSITION(p, chanId, CliStateOS, \
+                       ULTRA_CHANNEL_CLIENT_TRANSITION(p, chanId,      \
                                                        newstate, logCtx); \
                        visorchannel_write                              \
                                (chan,                                  \
index 2695649d3b68f260a9bea94866f8f090726a6202..611be777c5215584725123d015fe0fe9d9b65ea7 100644 (file)
@@ -207,24 +207,6 @@ visorchannel_get_memregion(VISORCHANNEL *channel)
 }
 EXPORT_SYMBOL_GPL(visorchannel_get_memregion);
 
-pSIGNAL_QUEUE_HEADER
-visorchannel_get_safe_queue(VISORCHANNEL *pchannel, U32 queue)
-{
-       switch (queue) {
-       case 0:
-               return &pchannel->safe_uis_queue.req_queue;
-       case 1:
-               return &pchannel->safe_uis_queue.rsp_queue;
-       case 2:
-               return &pchannel->safe_uis_queue.event_queue;
-       case 3:
-               return &pchannel->safe_uis_queue.ack_queue;
-       default:
-               ERRDRV("Invalid queue value %d\n", queue);
-               return NULL;
-       }
-}                              /* end visorchannel_get_safe_queue */
-
 int
 visorchannel_read(VISORCHANNEL *channel, ulong offset,
                  void *local, ulong nbytes)
@@ -434,60 +416,6 @@ Away:
 }
 EXPORT_SYMBOL_GPL(visorchannel_signalremove);
 
-BOOL
-visorchannel_safesignalremove(VISORCHANNEL *channel, U32 queue, void *msg)
-{
-       BOOL rc = FALSE;
-       SIGNAL_QUEUE_HEADER *psafe_sqh, unsafe_sqh;
-       int stat;
-
-       if (channel->needs_lock)
-               spin_lock(&channel->remove_lock);
-
-       if (!sig_read_header(channel, queue, &unsafe_sqh))
-               RETBOOL(FALSE);
-
-       psafe_sqh = visorchannel_get_safe_queue(channel, queue);
-       if (psafe_sqh == NULL) {
-               ERRDRV("safesignalremove: get_safe_queue failed\n");
-               RETBOOL(FALSE);
-       }
-
-       stat =
-           safe_sig_queue_validate(psafe_sqh, &unsafe_sqh, &unsafe_sqh.Head,
-                                   &unsafe_sqh.Tail);
-       if (stat == 0) {
-               ERRDRV("safe_signal_remove: safe_sig_queue_validate failed, queue = %d",
-                    queue);
-               RETBOOL(FALSE);
-       }
-
-       if (unsafe_sqh.Head == unsafe_sqh.Tail)
-               RETBOOL(FALSE); /* no signals to remove */
-       unsafe_sqh.Tail = (unsafe_sqh.Tail + 1) % psafe_sqh->MaxSignalSlots;
-       if (!sig_read_data(channel, queue, psafe_sqh, unsafe_sqh.Tail, msg))
-               FAIL("sig_read_data failed", FALSE);
-       unsafe_sqh.NumSignalsReceived++;
-
-       /* For each data field in SIGNAL_QUEUE_HEADER that was modified,
-        * update host memory.
-        */
-       MEMORYBARRIER;
-       if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, Tail))
-               FAIL("visor_memregion_write of Tail failed", FALSE);
-       if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, NumSignalsReceived))
-               FAIL("visor_memregion_write of NumSignalsReceived failed",
-                    FALSE);
-
-       RETBOOL(TRUE);
-
-Away:
-       if (channel->needs_lock)
-               spin_unlock(&channel->remove_lock);
-
-       return rc;
-}                              /* end visorchannel_safesignalremove */
-
 BOOL
 visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
 {
@@ -566,70 +494,6 @@ visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, U32 queue)
 }
 EXPORT_SYMBOL_GPL(visorchannel_signalqueue_max_slots);
 
-BOOL
-visorchannel_safesignalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
-{
-       BOOL rc = FALSE;
-       SIGNAL_QUEUE_HEADER *psafe_sqh, unsafe_sqh;
-       int stat;
-
-       if (channel->needs_lock)
-               spin_lock(&channel->insert_lock);
-
-       if (!sig_read_header(channel, queue, &unsafe_sqh))
-               RETBOOL(FALSE);
-
-       psafe_sqh = visorchannel_get_safe_queue(channel, queue);
-       if (psafe_sqh == NULL) {
-               ERRDRV("safesignalinsert: get_safe_queue failed\n");
-               RETBOOL(FALSE);
-       }
-
-       unsafe_sqh.Head = ((unsafe_sqh.Head + 1) % psafe_sqh->MaxSignalSlots);
-
-       stat =
-           safe_sig_queue_validate(psafe_sqh, &unsafe_sqh, &unsafe_sqh.Head,
-                                   &unsafe_sqh.Tail);
-       if (stat == 0) {
-               ERRDRV("safe_signal_insert: safe_sig_queue_validate failed, queue = %d",
-                    queue);
-               RETBOOL(FALSE);
-       }
-
-       if (unsafe_sqh.Head == unsafe_sqh.Tail) {
-#if 0
-               ERRDRV("visorchannel queue #%d overflow (max slots=%d)",
-                      queue, psafe_sqh->MaxSignalSlots);
-#endif
-               unsafe_sqh.NumOverflows++;
-               if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, NumOverflows))
-                       FAIL("visor_memregion_write of NumOverflows failed",
-                            FALSE);
-               RETBOOL(FALSE);
-       }
-
-       if (!sig_write_data(channel, queue, psafe_sqh, unsafe_sqh.Head, msg))
-               FAIL("sig_write_data failed", FALSE);
-       unsafe_sqh.NumSignalsSent++;
-
-       /* For each data field in SIGNAL_QUEUE_HEADER that was modified,
-        * update host memory.
-        */
-       MEMORYBARRIER;
-       if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, Head))
-               FAIL("visor_memregion_write of Head failed", FALSE);
-       if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, NumSignalsSent))
-               FAIL("visor_memregion_write of NumSignalsSent failed", FALSE);
-
-       RETBOOL(TRUE);
-
-Away:
-       if (channel->needs_lock)
-               spin_unlock(&channel->insert_lock);
-
-       return rc;
-}                              /* end visorchannel_safesignalinsert */
-
 static void
 sigqueue_debug(SIGNAL_QUEUE_HEADER *q, int which, struct seq_file *seq)
 {