forked from Minki/linux
staging: unisys: refactor handle_command()
First, fix the CamelCase local variable names: parametersAddr => parm_addr parametersBytes => parm_bytes isLocalAddr => local_addr Change the type of local_addr to bool instead of using the #defined type. Update all references to use the fixed names. Fix the indentation of that line that's over the 80 column limit. Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6a55e3c337
commit
818352a852
@ -1645,34 +1645,34 @@ static BOOL
|
|||||||
handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
|
handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
|
||||||
{
|
{
|
||||||
struct controlvm_message_packet *cmd = &inmsg.cmd;
|
struct controlvm_message_packet *cmd = &inmsg.cmd;
|
||||||
u64 parametersAddr = 0;
|
u64 parm_addr = 0;
|
||||||
u32 parametersBytes = 0;
|
u32 parm_bytes = 0;
|
||||||
struct parser_context *parser_ctx = NULL;
|
struct parser_context *parser_ctx = NULL;
|
||||||
BOOL isLocalAddr = FALSE;
|
bool local_addr = false;
|
||||||
struct controlvm_message ackmsg;
|
struct controlvm_message ackmsg;
|
||||||
|
|
||||||
/* create parsing context if necessary */
|
/* create parsing context if necessary */
|
||||||
isLocalAddr = (inmsg.hdr.flags.test_message == 1);
|
local_addr = (inmsg.hdr.flags.test_message == 1);
|
||||||
if (channel_addr == 0)
|
if (channel_addr == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
parametersAddr = channel_addr + inmsg.hdr.payload_vm_offset;
|
parm_addr = channel_addr + inmsg.hdr.payload_vm_offset;
|
||||||
parametersBytes = inmsg.hdr.payload_bytes;
|
parm_bytes = inmsg.hdr.payload_bytes;
|
||||||
|
|
||||||
/* Parameter and channel addresses within test messages actually lie
|
/* Parameter and channel addresses within test messages actually lie
|
||||||
* within our OS-controlled memory. We need to know that, because it
|
* within our OS-controlled memory. We need to know that, because it
|
||||||
* makes a difference in how we compute the virtual address.
|
* makes a difference in how we compute the virtual address.
|
||||||
*/
|
*/
|
||||||
if (parametersAddr != 0 && parametersBytes != 0) {
|
if (parm_addr != 0 && parm_bytes != 0) {
|
||||||
BOOL retry = FALSE;
|
BOOL retry = FALSE;
|
||||||
|
|
||||||
parser_ctx =
|
parser_ctx =
|
||||||
parser_init_byte_stream(parametersAddr, parametersBytes,
|
parser_init_byte_stream(parm_addr, parm_bytes,
|
||||||
isLocalAddr, &retry);
|
local_addr, &retry);
|
||||||
if (!parser_ctx && retry)
|
if (!parser_ctx && retry)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isLocalAddr) {
|
if (!local_addr) {
|
||||||
controlvm_init_response(&ackmsg, &inmsg.hdr,
|
controlvm_init_response(&ackmsg, &inmsg.hdr,
|
||||||
CONTROLVM_RESP_SUCCESS);
|
CONTROLVM_RESP_SUCCESS);
|
||||||
if (controlvm_channel)
|
if (controlvm_channel)
|
||||||
@ -1728,7 +1728,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
|
|||||||
default:
|
default:
|
||||||
if (inmsg.hdr.flags.response_expected)
|
if (inmsg.hdr.flags.response_expected)
|
||||||
controlvm_respond(&inmsg.hdr,
|
controlvm_respond(&inmsg.hdr,
|
||||||
-CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN);
|
-CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user