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 a4442c33bb8b3bbd549b403f33cab6d8a39be161..677627c72c4c5a491d0c0162e95451e6ee68bd76 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 70fcd1facd8aec91a8eefe0ecd8055987ccc2a5e..300a65dc5c6c005f2982a9ae19df261f346ee428 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 ed4eced1e2d222de053a77b0dbc4bb3631ef158e..59871495ea85b180bcda36d54e5695a6c5294c3a 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 e968f33380dcd1628e4ed6d82548274aaa76fa0e..5a7a87efed27d3a9eab19ea3c0358b324c787672 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 8e70b36f16f71c780db0516070dc9a1d15636211..136700756485ffb4dc372ede3c8a8ddee870e895 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++;