@@ -283,8 +283,9 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
283
283
return ERR_PTR (- ENOMEM );
284
284
}
285
285
for (col = 0 ; col < P9_ROW_MAXTAG ; col ++ ) {
286
- c -> reqs [row ][col ].status = REQ_STATUS_IDLE ;
287
- c -> reqs [row ][col ].tc = NULL ;
286
+ req = & c -> reqs [row ][col ];
287
+ req -> status = REQ_STATUS_IDLE ;
288
+ init_waitqueue_head (& req -> wq );
288
289
}
289
290
c -> max_tag += P9_ROW_MAXTAG ;
290
291
}
@@ -294,13 +295,6 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
294
295
col = tag % P9_ROW_MAXTAG ;
295
296
296
297
req = & c -> reqs [row ][col ];
297
- if (!req -> wq ) {
298
- req -> wq = kmalloc (sizeof (wait_queue_head_t ), GFP_NOFS );
299
- if (!req -> wq )
300
- goto grow_failed ;
301
- init_waitqueue_head (req -> wq );
302
- }
303
-
304
298
if (!req -> tc )
305
299
req -> tc = p9_fcall_alloc (alloc_msize );
306
300
if (!req -> rc )
@@ -320,9 +314,7 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
320
314
pr_err ("Couldn't grow tag array\n" );
321
315
kfree (req -> tc );
322
316
kfree (req -> rc );
323
- kfree (req -> wq );
324
317
req -> tc = req -> rc = NULL ;
325
- req -> wq = NULL ;
326
318
return ERR_PTR (- ENOMEM );
327
319
}
328
320
@@ -410,7 +402,6 @@ static void p9_tag_cleanup(struct p9_client *c)
410
402
/* free requests associated with tags */
411
403
for (row = 0 ; row < (c -> max_tag /P9_ROW_MAXTAG ); row ++ ) {
412
404
for (col = 0 ; col < P9_ROW_MAXTAG ; col ++ ) {
413
- kfree (c -> reqs [row ][col ].wq );
414
405
kfree (c -> reqs [row ][col ].tc );
415
406
kfree (c -> reqs [row ][col ].rc );
416
407
}
@@ -453,7 +444,7 @@ void p9_client_cb(struct p9_client *c, struct p9_req_t *req, int status)
453
444
smp_wmb ();
454
445
req -> status = status ;
455
446
456
- wake_up (req -> wq );
447
+ wake_up (& req -> wq );
457
448
p9_debug (P9_DEBUG_MUX , "wakeup: %d\n" , req -> tc -> tag );
458
449
}
459
450
EXPORT_SYMBOL (p9_client_cb );
@@ -774,7 +765,7 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
774
765
}
775
766
again :
776
767
/* Wait for the response */
777
- err = wait_event_killable (* req -> wq , req -> status >= REQ_STATUS_RCVD );
768
+ err = wait_event_killable (req -> wq , req -> status >= REQ_STATUS_RCVD );
778
769
779
770
/*
780
771
* Make sure our req is coherent with regard to updates in other
0 commit comments