Skip to content

Commit

Permalink
xenbus: simplify xenbus_dev_request_and_reply()
Browse files Browse the repository at this point in the history
No need to retain a local copy of the full request message, only the
type is really needed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
  • Loading branch information
Jan Beulich authored and David Vrabel committed Jul 8, 2016
1 parent 7469be9 commit e5a7947
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/xen/xenbus/xenbus_xs.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ static void transaction_resume(void)
void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg)
{
void *ret;
struct xsd_sockmsg req_msg = *msg;
enum xsd_sockmsg_type type = msg->type;
int err;

if (req_msg.type == XS_TRANSACTION_START)
if (type == XS_TRANSACTION_START)
transaction_start();

mutex_lock(&xs_state.request_mutex);
Expand All @@ -250,8 +250,7 @@ void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg)
mutex_unlock(&xs_state.request_mutex);

if ((msg->type == XS_TRANSACTION_END) ||
((req_msg.type == XS_TRANSACTION_START) &&
(msg->type == XS_ERROR)))
((type == XS_TRANSACTION_START) && (msg->type == XS_ERROR)))
transaction_end();

return ret;
Expand Down

0 comments on commit e5a7947

Please sign in to comment.