Commit 1c1ed292 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: refactor controlvm_periodic_work()

Fix the CamelCase variable names:

gotACommand => got_command
Poll_Count => poll_count
Away => cleanup

Fix all references to use the new names. Remove the empty braces in the
while() and put in a trailing semicolon, for clarity.
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 818352a8
...@@ -1754,24 +1754,24 @@ static void ...@@ -1754,24 +1754,24 @@ static void
controlvm_periodic_work(struct work_struct *work) controlvm_periodic_work(struct work_struct *work)
{ {
struct controlvm_message inmsg; struct controlvm_message inmsg;
BOOL gotACommand = FALSE; BOOL got_command = FALSE;
BOOL handle_command_failed = FALSE; BOOL handle_command_failed = FALSE;
static u64 Poll_Count; static u64 poll_count;
/* make sure visorbus server is registered for controlvm callbacks */ /* make sure visorbus server is registered for controlvm callbacks */
if (visorchipset_serverregwait && !serverregistered) if (visorchipset_serverregwait && !serverregistered)
goto Away; goto cleanup;
/* make sure visorclientbus server is regsitered for controlvm /* make sure visorclientbus server is regsitered for controlvm
* callbacks * callbacks
*/ */
if (visorchipset_clientregwait && !clientregistered) if (visorchipset_clientregwait && !clientregistered)
goto Away; goto cleanup;
Poll_Count++; poll_count++;
if (Poll_Count >= 250) if (poll_count >= 250)
; /* keep going */ ; /* keep going */
else else
goto Away; goto cleanup;
/* Check events to determine if response to CHIPSET_READY /* Check events to determine if response to CHIPSET_READY
* should be sent * should be sent
...@@ -1790,7 +1790,7 @@ controlvm_periodic_work(struct work_struct *work) ...@@ -1790,7 +1790,7 @@ controlvm_periodic_work(struct work_struct *work)
CONTROLVM_QUEUE_RESPONSE, CONTROLVM_QUEUE_RESPONSE,
&inmsg)) &inmsg))
; ;
if (!gotACommand) { if (!got_command) {
if (ControlVm_Pending_Msg_Valid) { if (ControlVm_Pending_Msg_Valid) {
/* we throttled processing of a prior /* we throttled processing of a prior
* msg, so try to process it again * msg, so try to process it again
...@@ -1798,19 +1798,19 @@ controlvm_periodic_work(struct work_struct *work) ...@@ -1798,19 +1798,19 @@ controlvm_periodic_work(struct work_struct *work)
*/ */
inmsg = ControlVm_Pending_Msg; inmsg = ControlVm_Pending_Msg;
ControlVm_Pending_Msg_Valid = FALSE; ControlVm_Pending_Msg_Valid = FALSE;
gotACommand = TRUE; got_command = true;
} else { } else {
gotACommand = read_controlvm_event(&inmsg); got_command = read_controlvm_event(&inmsg);
} }
} }
handle_command_failed = FALSE; handle_command_failed = FALSE;
while (gotACommand && (!handle_command_failed)) { while (got_command && (!handle_command_failed)) {
most_recent_message_jiffies = jiffies; most_recent_message_jiffies = jiffies;
if (handle_command(inmsg, if (handle_command(inmsg,
visorchannel_get_physaddr visorchannel_get_physaddr
(controlvm_channel))) (controlvm_channel)))
gotACommand = read_controlvm_event(&inmsg); got_command = read_controlvm_event(&inmsg);
else { else {
/* this is a scenario where throttling /* this is a scenario where throttling
* is required, but probably NOT an * is required, but probably NOT an
...@@ -1827,7 +1827,7 @@ controlvm_periodic_work(struct work_struct *work) ...@@ -1827,7 +1827,7 @@ controlvm_periodic_work(struct work_struct *work)
/* parahotplug_worker */ /* parahotplug_worker */
parahotplug_process_list(); parahotplug_process_list();
Away: cleanup:
if (time_after(jiffies, if (time_after(jiffies,
most_recent_message_jiffies + (HZ * MIN_IDLE_SECONDS))) { most_recent_message_jiffies + (HZ * MIN_IDLE_SECONDS))) {
......
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