Skip to content

Commit e5a7947

Browse files
jbeulichDavid Vrabel
authored andcommitted
xenbus: simplify xenbus_dev_request_and_reply()
No need to retain a local copy of the full request message, only the type is really needed. Signed-off-by: Jan Beulich <[email protected]> Signed-off-by: David Vrabel <[email protected]>
1 parent 7469be9 commit e5a7947

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/xen/xenbus/xenbus_xs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ static void transaction_resume(void)
232232
void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg)
233233
{
234234
void *ret;
235-
struct xsd_sockmsg req_msg = *msg;
235+
enum xsd_sockmsg_type type = msg->type;
236236
int err;
237237

238-
if (req_msg.type == XS_TRANSACTION_START)
238+
if (type == XS_TRANSACTION_START)
239239
transaction_start();
240240

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

252252
if ((msg->type == XS_TRANSACTION_END) ||
253-
((req_msg.type == XS_TRANSACTION_START) &&
254-
(msg->type == XS_ERROR)))
253+
((type == XS_TRANSACTION_START) && (msg->type == XS_ERROR)))
255254
transaction_end();
256255

257256
return ret;

0 commit comments

Comments
 (0)