Remove the unnecessary macro ULTRA_CHANNEL_CLIENT_RELEASE_OS(), rename
the function to spar_channel_client_release_os(), fix references to the
macro to call the function directly instead, remove the unnecessary
logCtx, file, and line parameters, and fix CamelCase names:

pChannel => ch
chanId => id
pChan => hdr

Signed-off-by: Benjamin Romer <benjamin.ro...@unisys.com>
---
 .../unisys/common-spar/include/channels/channel.h  | 32 ++++++++--------------
 drivers/staging/unisys/uislib/uisqueue.c           |  2 +-
 drivers/staging/unisys/virthba/virthba.c           |  3 +-
 3 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index 8c3fdf7..84f6462 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -149,10 +149,6 @@ ULTRA_CHANNELCLI_STRING(u32 v)
                mb(); /* required for channel synch */                  \
        } while (0)
 
-#define ULTRA_CHANNEL_CLIENT_RELEASE_OS(pChan, chanId, logCtx) \
-       ULTRA_channel_client_release_os(pChan, chanId, logCtx,  \
-               (char *)__FILE__, __LINE__, (char *)__func__)
-
 /* Values for ULTRA_CHANNEL_PROTOCOL.CliErrorBoot: */
 /* throttling invalid boot channel statetransition error due to client
  * disabled */
@@ -494,29 +490,25 @@ spar_channel_client_acquire_os(void __iomem *ch, u8 *id)
 }
 
 static inline void
-ULTRA_channel_client_release_os(void __iomem *pChannel, u8 *chanId,
-                               void *logCtx, char *file, int line, char *func)
+spar_channel_client_release_os(void __iomem *ch, u8 *id)
 {
-       struct channel_header __iomem *pChan = pChannel;
+       struct channel_header __iomem *hdr = ch;
 
-       if (readb(&pChan->cli_error_os) != 0) {
+       if (readb(&hdr->cli_error_os) != 0) {
                /* we are in an error msg throttling state; come out of it */
-               pr_info("%s Channel OS client error state cleared @%s:%d\n",
-                       chanId, pathname_last_n_nodes((u8 *) file, 4),
-                       line);
-               writeb(0, &pChan->cli_error_os);
+               pr_info("%s Channel OS client error state cleared\n", id);
+               writeb(0, &hdr->cli_error_os);
        }
-       if (readl(&pChan->cli_state_os) == CHANNELCLI_OWNED)
+       if (readl(&hdr->cli_state_os) == CHANNELCLI_OWNED)
                return;
-       if (readl(&pChan->cli_state_os) != CHANNELCLI_BUSY) {
-               pr_info("%s Channel StateTransition INVALID! - release failed 
because OS client NOT BUSY (state=%s(%d)) @%s:%d\n",
-                       chanId, ULTRA_CHANNELCLI_STRING(
-                                       readl(&pChan->cli_state_os)),
-                       readl(&pChan->cli_state_os),
-                       pathname_last_n_nodes((u8 *) file, 4), line);
+       if (readl(&hdr->cli_state_os) != CHANNELCLI_BUSY) {
+               pr_info("%s Channel StateTransition INVALID! - release failed 
because OS client NOT BUSY (state=%s(%d))\n",
+                       id, ULTRA_CHANNELCLI_STRING(
+                                       readl(&hdr->cli_state_os)),
+                       readl(&hdr->cli_state_os));
                /* return; */
        }
-       writel(CHANNELCLI_ATTACHED, &pChan->cli_state_os); /* release busy */
+       writel(CHANNELCLI_ATTACHED, &hdr->cli_state_os); /* release busy */
 }
 
 /*
diff --git a/drivers/staging/unisys/uislib/uisqueue.c 
b/drivers/staging/unisys/uislib/uisqueue.c
index 27d0b20..b9694a6 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -87,7 +87,7 @@ do_locked_client_insert(struct uisqueue_info *queueinfo,
                queueinfo->packets_sent++;
                rc = 1;
        }
-       ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId, NULL);
+       spar_channel_client_release_os(queueinfo->chan, channelId);
 unlock:
        spin_unlock_irqrestore((spinlock_t *)lock, flags);
        return rc;
diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index 5c79455..df0e89c 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -1285,8 +1285,7 @@ drain_queue(struct virthba_info *virthbainfo, struct 
chaninfo *dc,
                }
                qrslt = uisqueue_get_cmdrsp(dc->queueinfo, cmdrsp,
                                            IOCHAN_FROM_IOPART);
-               ULTRA_CHANNEL_CLIENT_RELEASE_OS(dc->queueinfo->chan,
-                                               "vhba", NULL);
+               spar_channel_client_release_os(dc->queueinfo->chan, "vhba");
                spin_unlock_irqrestore(&virthbainfo->chinfo.insertlock, flags);
                if (qrslt == 0)
                        break;
-- 
1.9.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to