]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xenbus: simplify xenbus_dev_request_and_reply()
authorJan Beulich <JBeulich@suse.com>
Thu, 7 Jul 2016 07:32:35 +0000 (01:32 -0600)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 13 Jul 2016 17:27:57 +0000 (13:27 -0400)
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>
(cherry picked from commit e5a79475a7ae171fef82608c6e11f51bb85a6745)
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
OraBug: 23585393

drivers/xen/xenbus/xenbus_xs.c

index ce65591b4168f132f3c0dc1d631b9e0593a86176..b4c3c11d0e239d599a1109ec3914178209fedb44 100644 (file)
@@ -233,10 +233,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);
@@ -251,8 +251,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;