]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
xenbus: simplify xenbus_dev_request_and_reply()
authorJan Beulich <jbeulich@novell.com>
Wed, 1 Jun 2011 15:17:19 +0000 (16:17 +0100)
committerJan Beulich <jbeulich@novell.com>
Wed, 1 Jun 2011 15:17:19 +0000 (16:17 +0100)
No need to retain a local copy of the full request message, only the
type is really needed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
drivers/xen/xenbus/xenbus_xs.c

index 99a8614c7aad9c018e1fd687508c1e1e5f3ba8d0..90fa8a7de88be23da5c9ed8f05b15378d78c492b 100644 (file)
@@ -203,10 +203,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);
@@ -220,9 +220,8 @@ void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg)
 
        mutex_unlock(&xs_state.request_mutex);
 
-       if ((req_msg.type == XS_TRANSACTION_END) ||
-           ((req_msg.type == XS_TRANSACTION_START) &&
-            (msg->type == XS_ERROR)))
+       if ((type == XS_TRANSACTION_END) ||
+           ((type == XS_TRANSACTION_START) && (msg->type == XS_ERROR)))
                transaction_end();
 
        return ret;