Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1438229

[PATCH 2/2] xenbus: simplify xenbus_dev_request_and_reply()

From "Jan Beulich" <JBeulich@suse.com>
Newsgroups linux.kernel
Subject [PATCH 2/2] xenbus: simplify xenbus_dev_request_and_reply()
Date 2016-07-07 09:40 +0200
Message-ID <rSc4G-3S8-19@gated-at.bofh.it> (permalink)
References <rSbUZ-3OW-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/xen/xenbus/xenbus_xs.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- 4.7-rc6-xen.orig/drivers/xen/xenbus/xenbus_xs.c
+++ 4.7-rc6-xen/drivers/xen/xenbus/xenbus_xs.c
@@ -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);
@@ -250,8 +250,7 @@ void *xenbus_dev_request_and_reply(struc
 	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;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] xenbus: xenbus_dev_request_and_reply() adjustments "Jan Beulich" <JBeulich@suse.com> - 2016-07-07 09:30 +0200
  [PATCH 2/2] xenbus: simplify xenbus_dev_request_and_reply() "Jan Beulich" <JBeulich@suse.com> - 2016-07-07 09:40 +0200
  [PATCH 1/2] xenbus: don't bail early from  xenbus_dev_request_and_reply() "Jan Beulich" <JBeulich@suse.com> - 2016-07-07 09:40 +0200
    Re: [Xen-devel] [PATCH 1/2] xenbus: don't bail early from  xenbus_dev_request_and_reply() David Vrabel <david.vrabel@citrix.com> - 2016-07-07 13:40 +0200
      Re: [Xen-devel] [PATCH 1/2] xenbus: don't bail early from  xenbus_dev_request_and_reply() "Jan Beulich" <JBeulich@suse.com> - 2016-07-07 14:10 +0200
        Re: [Xen-devel] [PATCH 1/2] xenbus: don't bail early from  xenbus_dev_request_and_reply() David Vrabel <david.vrabel@citrix.com> - 2016-07-07 14:20 +0200
          Re: [Xen-devel] [PATCH 1/2] xenbus: don't bail early from  xenbus_dev_request_and_reply() "Jan Beulich" <JBeulich@suse.com> - 2016-07-07 14:30 +0200
            Re: [Xen-devel] [PATCH 1/2] xenbus: don't bail early from  xenbus_dev_request_and_reply() David Vrabel <david.vrabel@citrix.com> - 2016-07-07 15:20 +0200
              Re: [Xen-devel] [PATCH 1/2] xenbus: don't bail early from  xenbus_dev_request_and_reply() David Vrabel <david.vrabel@citrix.com> - 2016-07-07 15:30 +0200
                Re: [Xen-devel] [PATCH 1/2] xenbus: don't bail early from  xenbus_dev_request_and_reply() "Jan Beulich" <JBeulich@suse.com> - 2016-07-07 16:00 +0200
                Re: [Xen-devel] [PATCH 1/2] xenbus: don't bail early from  xenbus_dev_request_and_reply() David Vrabel <david.vrabel@citrix.com> - 2016-07-08 12:20 +0200
  Re: [Xen-devel] [PATCH 0/2] xenbus: xenbus_dev_request_and_reply()  adjustments David Vrabel <david.vrabel@citrix.com> - 2016-07-08 13:00 +0200

csiph-web