summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorBenjamin Romer <benjamin.romer@unisys.com>2014-12-05 17:08:57 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 17:32:33 -0800
commit027b8c5b8b6cea2adc2db655841c9d24001bc6d4 (patch)
tree587de4b7d7e1c00b222be458a435e88a3e57692c /drivers/staging
parent441a29a57e1d88a280308b860d57ac45bd77903a (diff)
staging: unisys: refactor resume_device()
Fix the function declaration so it is a single line. Fix CamelCase local variable names: busNo => bus_no devNo => dev_no Fix use of uuid_le_cmp() to check for 0 instead of using !uuid_le_cmp(). Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/unisys/uislib/uislib.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
index 35be4e6a92e3..ca52f47f56d8 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -593,32 +593,31 @@ static int pause_device(struct controlvm_message *msg)
return retval;
}
-static int
-resume_device(struct controlvm_message *msg)
+static int resume_device(struct controlvm_message *msg)
{
- u32 busNo, devNo;
+ u32 bus_no, dev_no;
struct bus_info *bus;
struct device_info *dev;
struct guest_msgs cmd;
int retval = CONTROLVM_RESP_SUCCESS;
- busNo = msg->cmd.device_change_state.bus_no;
- devNo = msg->cmd.device_change_state.dev_no;
+ bus_no = msg->cmd.device_change_state.bus_no;
+ dev_no = msg->cmd.device_change_state.dev_no;
read_lock(&bus_list_lock);
for (bus = bus_list; bus; bus = bus->next) {
- if (bus->bus_no == busNo) {
+ if (bus->bus_no == bus_no) {
/* make sure the device number is valid */
- if (devNo >= bus->device_count) {
+ if (dev_no >= bus->device_count) {
LOGERR("CONTROLVM_DEVICE_CHANGESTATE:resume Failed: device(%d) >= deviceCount(%d).",
- devNo, bus->device_count);
+ dev_no, bus->device_count);
retval = CONTROLVM_RESP_ERROR_DEVICE_INVALID;
} else {
/* make sure this device exists */
- dev = bus->device[devNo];
+ dev = bus->device[dev_no];
if (!dev) {
LOGERR("CONTROLVM_DEVICE_CHANGESTATE:resume Failed: device %d does not exist.",
- devNo);
+ dev_no);
retval =
CONTROLVM_RESP_ERROR_ALREADY_DONE;
}
@@ -629,7 +628,7 @@ resume_device(struct controlvm_message *msg)
if (!bus) {
LOGERR("CONTROLVM_DEVICE_CHANGESTATE:resume Failed: bus %d does not exist",
- busNo);
+ bus_no);
retval = CONTROLVM_RESP_ERROR_BUS_INVALID;
}
read_unlock(&bus_list_lock);
@@ -637,12 +636,12 @@ resume_device(struct controlvm_message *msg)
* guest_msgs struct to callback
*/
if (retval == CONTROLVM_RESP_SUCCESS) {
- if (!uuid_le_cmp(dev->channel_uuid,
- spar_vhba_channel_protocol_uuid)) {
+ if (uuid_le_cmp(dev->channel_uuid,
+ spar_vhba_channel_protocol_uuid) == 0) {
cmd.msgtype = GUEST_RESUME_VHBA;
cmd.resume_vhba.chanptr = dev->chanptr;
- } else if (!uuid_le_cmp(dev->channel_uuid,
- spar_vnic_channel_protocol_uuid)) {
+ } else if (uuid_le_cmp(dev->channel_uuid,
+ spar_vnic_channel_protocol_uuid) == 0) {
cmd.msgtype = GUEST_RESUME_VNIC;
cmd.resume_vnic.chanptr = dev->chanptr;
} else {