Commit 0278a905 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: refactor my_device_changestate()

Fix the CamelCase names:

busNo => bus_no
devNo => dev_no
pDevInfo => dev_info

Update all references to use the new names, and remove the goto and
label entirely.
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c60c8e26
...@@ -1207,31 +1207,28 @@ static void ...@@ -1207,31 +1207,28 @@ static void
my_device_changestate(struct controlvm_message *inmsg) my_device_changestate(struct controlvm_message *inmsg)
{ {
struct controlvm_message_packet *cmd = &inmsg->cmd; struct controlvm_message_packet *cmd = &inmsg->cmd;
ulong busNo = cmd->device_change_state.bus_no; ulong bus_no = cmd->device_change_state.bus_no;
ulong devNo = cmd->device_change_state.dev_no; ulong dev_no = cmd->device_change_state.dev_no;
struct spar_segment_state state = cmd->device_change_state.state; struct spar_segment_state state = cmd->device_change_state.state;
struct visorchipset_device_info *pDevInfo = NULL; struct visorchipset_device_info *dev_info = NULL;
int rc = CONTROLVM_RESP_SUCCESS; int rc = CONTROLVM_RESP_SUCCESS;
pDevInfo = finddevice(&dev_info_list, busNo, devNo); dev_info = finddevice(&dev_info_list, bus_no, dev_no);
if (!pDevInfo) { if (!dev_info) {
POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo, POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
POSTCODE_SEVERITY_ERR); POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
goto Away; } else if (dev_info->state.created == 0) {
} POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
if (pDevInfo->state.created == 0) {
POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
POSTCODE_SEVERITY_ERR); POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID; rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
} }
Away: if ((rc >= CONTROLVM_RESP_SUCCESS) && dev_info)
if ((rc >= CONTROLVM_RESP_SUCCESS) && pDevInfo) device_epilog(bus_no, dev_no, state,
device_epilog(busNo, devNo, state, CONTROLVM_DEVICE_CHANGESTATE, CONTROLVM_DEVICE_CHANGESTATE, &inmsg->hdr, rc,
&inmsg->hdr, rc,
inmsg->hdr.flags.response_expected == 1, inmsg->hdr.flags.response_expected == 1,
FOR_VISORBUS( FOR_VISORBUS(
pDevInfo->chan_info.channel_type_uuid)); dev_info->chan_info.channel_type_uuid));
} }
static void static void
......
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