Commit 20eca8f0 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: refactor create_bus()

Fix the missing braces and logical continuation problems in create_bus().
Signed-off-by: default avatarKen Depro <kenneth.depro@unisys.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dddfe8e6
...@@ -192,8 +192,10 @@ create_bus(struct controlvm_message *msg, char *buf) ...@@ -192,8 +192,10 @@ create_bus(struct controlvm_message *msg, char *buf)
bus->guest_handle = 0; bus->guest_handle = 0;
bus->bus_no = busNo; bus->bus_no = busNo;
bus->local_vnic = 1; bus->local_vnic = 1;
} else } else {
bus->bus_no = bus->guest_handle = busNo; bus->bus_no = busNo;
bus->guest_handle = busNo;
}
sprintf(bus->name, "%d", (int)bus->bus_no); sprintf(bus->name, "%d", (int)bus->bus_no);
bus->device_count = deviceCount; bus->device_count = deviceCount;
bus->device = bus->device =
...@@ -220,8 +222,8 @@ create_bus(struct controlvm_message *msg, char *buf) ...@@ -220,8 +222,8 @@ create_bus(struct controlvm_message *msg, char *buf)
kfree(bus); kfree(bus);
return CONTROLVM_RESP_ERROR_ALREADY_DONE; return CONTROLVM_RESP_ERROR_ALREADY_DONE;
} }
if ((msg->cmd.create_bus.channel_addr != 0) if ((msg->cmd.create_bus.channel_addr != 0) &&
&& (msg->cmd.create_bus.channel_bytes != 0)) { (msg->cmd.create_bus.channel_bytes != 0)) {
bus->bus_channel_bytes = msg->cmd.create_bus.channel_bytes; bus->bus_channel_bytes = msg->cmd.create_bus.channel_bytes;
bus->bus_channel = bus->bus_channel =
init_vbus_channel(msg->cmd.create_bus.channel_addr, init_vbus_channel(msg->cmd.create_bus.channel_addr,
...@@ -256,9 +258,9 @@ create_bus(struct controlvm_message *msg, char *buf) ...@@ -256,9 +258,9 @@ create_bus(struct controlvm_message *msg, char *buf)
/* add bus at the head of our list */ /* add bus at the head of our list */
write_lock(&BusListLock); write_lock(&BusListLock);
if (!BusListHead) if (!BusListHead) {
BusListHead = bus; BusListHead = bus;
else { } else {
bus->next = BusListHead; bus->next = BusListHead;
BusListHead = bus; BusListHead = bus;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment