staging: unisys: visorbus: Convert visorchannel_signalinsert() return val
authorDavid Binder <david.binder@unisys.com>
Mon, 26 Sep 2016 15:03:49 +0000 (11:03 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Sep 2016 11:06:16 +0000 (13:06 +0200)
Per Documentation/CodingStyle, function names that convey an action or an
imperative command should return an integer. This commit converts the
visorbus API function, visorchannel_signalinsert(), to returning integer
values. All uses of this function are updated accordingly.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/include/visorbus.h
drivers/staging/unisys/visorbus/visorchannel.c
drivers/staging/unisys/visorbus/visorchipset.c
drivers/staging/unisys/visorhba/visorhba_main.c
drivers/staging/unisys/visornic/visornic_main.c

index a4442c3..677627c 100644 (file)
@@ -202,8 +202,8 @@ enum diag_severity {
 
 int visorchannel_signalremove(struct visorchannel *channel, u32 queue,
                              void *msg);
-bool visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
-                              void *msg);
+int visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
+                             void *msg);
 bool visorchannel_signalempty(struct visorchannel *channel, u32 queue);
 uuid_le visorchannel_get_uuid(struct visorchannel *channel);
 
index 70fcd1f..300a65d 100644 (file)
@@ -493,12 +493,12 @@ visorchannel_create_with_lock(u64 physaddr, unsigned long channel_bytes,
  * @queue:   the queue the message will be added to
  * @msg:     the message to insert
  *
- * Return: boolean indicating whether the insertion succeeded or failed
+ * Return: integer error code indicating the status of the insertion
  */
-bool
+int
 visorchannel_signalinsert(struct visorchannel *channel, u32 queue, void *msg)
 {
-       bool rc;
+       int rc;
        unsigned long flags;
 
        if (channel->needs_lock) {
@@ -509,6 +509,6 @@ visorchannel_signalinsert(struct visorchannel *channel, u32 queue, void *msg)
                rc = signalinsert_inner(channel, queue, msg);
        }
 
-       return !rc;
+       return rc;
 }
 EXPORT_SYMBOL_GPL(visorchannel_signalinsert);
index ed4eced..5987149 100644 (file)
@@ -508,8 +508,8 @@ controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
 
        controlvm_init_response(&outmsg, msg_hdr, response);
        outmsg.cmd.init_chipset.features = features;
-       if (!visorchannel_signalinsert(controlvm_channel,
-                                      CONTROLVM_QUEUE_REQUEST, &outmsg)) {
+       if (visorchannel_signalinsert(controlvm_channel,
+                                     CONTROLVM_QUEUE_REQUEST, &outmsg)) {
                return;
        }
 }
@@ -557,8 +557,8 @@ controlvm_respond(struct controlvm_message_header *msg_hdr, int response)
        if (outmsg.hdr.flags.test_message == 1)
                return;
 
-       if (!visorchannel_signalinsert(controlvm_channel,
-                                      CONTROLVM_QUEUE_REQUEST, &outmsg)) {
+       if (visorchannel_signalinsert(controlvm_channel,
+                                     CONTROLVM_QUEUE_REQUEST, &outmsg)) {
                return;
        }
 }
@@ -572,8 +572,8 @@ static void controlvm_respond_physdev_changestate(
        controlvm_init_response(&outmsg, msg_hdr, response);
        outmsg.cmd.device_change_state.state = state;
        outmsg.cmd.device_change_state.flags.phys_device = 1;
-       if (!visorchannel_signalinsert(controlvm_channel,
-                                      CONTROLVM_QUEUE_REQUEST, &outmsg)) {
+       if (visorchannel_signalinsert(controlvm_channel,
+                                     CONTROLVM_QUEUE_REQUEST, &outmsg)) {
                return;
        }
 }
@@ -670,8 +670,8 @@ device_changestate_responder(enum controlvm_id cmd_id,
        outmsg.cmd.device_change_state.dev_no = dev_no;
        outmsg.cmd.device_change_state.state = response_state;
 
-       if (!visorchannel_signalinsert(controlvm_channel,
-                                      CONTROLVM_QUEUE_REQUEST, &outmsg))
+       if (visorchannel_signalinsert(controlvm_channel,
+                                     CONTROLVM_QUEUE_REQUEST, &outmsg))
                return;
 }
 
index e968f33..5a7a87e 100644 (file)
@@ -335,9 +335,9 @@ static int forward_taskmgmt_command(enum task_mgmt_types tasktype,
 
        dev_dbg(&scsidev->sdev_gendev,
                "visorhba: initiating type=%d taskmgmt command\n", tasktype);
-       if (!visorchannel_signalinsert(devdata->dev->visorchannel,
-                                      IOCHAN_TO_IOPART,
-                                      cmdrsp))
+       if (visorchannel_signalinsert(devdata->dev->visorchannel,
+                                     IOCHAN_TO_IOPART,
+                                     cmdrsp))
                goto err_del_scsipending_ent;
 
        /* It can take the Service Partition up to 35 seconds to complete
@@ -538,9 +538,9 @@ visorhba_queue_command_lck(struct scsi_cmnd *scsicmd,
        }
        cmdrsp->scsi.guest_phys_entries = scsi_sg_count(scsicmd);
 
-       if (!visorchannel_signalinsert(devdata->dev->visorchannel,
-                                      IOCHAN_TO_IOPART,
-                                      cmdrsp))
+       if (visorchannel_signalinsert(devdata->dev->visorchannel,
+                                     IOCHAN_TO_IOPART,
+                                     cmdrsp))
                /* queue must be full and we aren't going to wait */
                goto err_del_scsipending_ent;
 
index 8e70b36..1367007 100644 (file)
@@ -386,9 +386,9 @@ post_skb(struct uiscmdrsp *cmdrsp,
        if ((cmdrsp->net.rcvpost.frag.pi_off + skb->len) <= PI_PAGE_SIZE) {
                cmdrsp->net.type = NET_RCV_POST;
                cmdrsp->cmdtype = CMD_NET_TYPE;
-               if (visorchannel_signalinsert(devdata->dev->visorchannel,
-                                             IOCHAN_TO_IOPART,
-                                             cmdrsp)) {
+               if (!visorchannel_signalinsert(devdata->dev->visorchannel,
+                                              IOCHAN_TO_IOPART,
+                                              cmdrsp)) {
                        atomic_inc(&devdata->num_rcvbuf_in_iovm);
                        devdata->chstat.sent_post++;
                } else {
@@ -415,9 +415,9 @@ send_enbdis(struct net_device *netdev, int state,
        devdata->cmdrsp_rcv->net.enbdis.context = netdev;
        devdata->cmdrsp_rcv->net.type = NET_RCV_ENBDIS;
        devdata->cmdrsp_rcv->cmdtype = CMD_NET_TYPE;
-       if (visorchannel_signalinsert(devdata->dev->visorchannel,
-                                     IOCHAN_TO_IOPART,
-                                     devdata->cmdrsp_rcv))
+       if (!visorchannel_signalinsert(devdata->dev->visorchannel,
+                                      IOCHAN_TO_IOPART,
+                                      devdata->cmdrsp_rcv))
                devdata->chstat.sent_enbdis++;
 }
 
@@ -881,8 +881,8 @@ visornic_xmit(struct sk_buff *skb, struct net_device *netdev)
                return NETDEV_TX_OK;
        }
 
-       if (!visorchannel_signalinsert(devdata->dev->visorchannel,
-                                      IOCHAN_TO_IOPART, cmdrsp)) {
+       if (visorchannel_signalinsert(devdata->dev->visorchannel,
+                                     IOCHAN_TO_IOPART, cmdrsp)) {
                netif_stop_queue(netdev);
                spin_unlock_irqrestore(&devdata->priv_lock, flags);
                devdata->busy_cnt++;