Commit 55b33413 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: refactor parahotplug_process_list()

Simplify the code a little and shorten the indentation levels by
reversing the check for time_after_eq().
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cafefc0c
...@@ -1535,15 +1535,17 @@ parahotplug_process_list(void) ...@@ -1535,15 +1535,17 @@ parahotplug_process_list(void)
list_for_each_safe(pos, tmp, &Parahotplug_request_list) { list_for_each_safe(pos, tmp, &Parahotplug_request_list) {
struct parahotplug_request *req = struct parahotplug_request *req =
list_entry(pos, struct parahotplug_request, list); list_entry(pos, struct parahotplug_request, list);
if (time_after_eq(jiffies, req->expiration)) {
list_del(pos); if (!time_after_eq(jiffies, req->expiration))
if (req->msg.hdr.flags.response_expected) continue;
controlvm_respond_physdev_changestate(
&req->msg.hdr, list_del(pos);
CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT, if (req->msg.hdr.flags.response_expected)
req->msg.cmd.device_change_state.state); controlvm_respond_physdev_changestate(
parahotplug_request_destroy(req); &req->msg.hdr,
} CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT,
req->msg.cmd.device_change_state.state);
parahotplug_request_destroy(req);
} }
spin_unlock(&Parahotplug_request_list_lock); spin_unlock(&Parahotplug_request_list_lock);
...@@ -1621,7 +1623,7 @@ parahotplug_process_message(struct controlvm_message *inmsg) ...@@ -1621,7 +1623,7 @@ parahotplug_process_message(struct controlvm_message *inmsg)
* indicated it's done. * indicated it's done.
*/ */
spin_lock(&Parahotplug_request_list_lock); spin_lock(&Parahotplug_request_list_lock);
list_add_tail(&(req->list), &Parahotplug_request_list); list_add_tail(&req->list, &Parahotplug_request_list);
spin_unlock(&Parahotplug_request_list_lock); spin_unlock(&Parahotplug_request_list_lock);
parahotplug_request_kickoff(req); parahotplug_request_kickoff(req);
......
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