Skip to contentSkip to conversation

srp_daemon: Remove duplicate sync_res shutdown

PATCH Applied Jason Gunthorpe 4 participants 4 messages Dec 19, 2017 – Dec 25, 2017 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 srp_daemon: Remove duplicate sync_res shutdown

The very first thing free_res does is the same lock/signal/unlock sequence, so there is no reason to open code it before calling free_res.

res->sync_res always exists at this point so remove the assert too.

---
 srp_daemon/srp_daemon.c | 6 ------
 1 file changed, 6 deletions(-)

v3:
- Delete stray edit

Bart, Yes, must have been a stray editor edit, I did not even look at v2 in the mailer before sending it, since the one line change was so simple :( This one compiles.

srp_daemon/srp_daemon.c +0 -6
index cec36db2e0f12e..5995e6a6173046 100644
@@ -2073,12 +2073,6 @@ static int ibsrpdm(int argc, char *argv[])
 	if (ret)
 		pr_err("Querying SRP targets failed\n");
 
-	assert(res->sync_res);
-	pthread_mutex_lock(&res->sync_res->retry_mutex);
-	res->sync_res->stop_threads = 1;
-	pthread_cond_signal(&res->sync_res->retry_cond);
-	pthread_mutex_unlock(&res->sync_res->retry_mutex);
-
 	free_res(res);
 umad_done:
 	umad_done();
Signature · 6 lines
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20171219215102.GA28841-uk2M96/[email protected]

#2 lore raw

T24gVHVlLCAyMDE3LTEyLTE5IGF0IDE0OjUxIC0wNzAwLCBKYXNvbiBHdW50aG9ycGUgd3JvdGU6 DQo+IFRoZSB2ZXJ5IGZpcnN0IHRoaW5nIGZyZWVfcmVzIGRvZXMgaXMgdGhlIHNhbWUgbG9jay9z aWduYWwvdW5sb2NrDQo+IHNlcXVlbmNlLCBzbyB0aGVyZSBpcyBubyByZWFzb24gdG8gb3BlbiBj b2RlIGl0IGJlZm9yZSBjYWxsaW5nDQo+IGZyZWVfcmVzLg0KPiANCj4gcmVzLT5zeW5jX3JlcyBh bHdheXMgZXhpc3RzIGF0IHRoaXMgcG9pbnQgc28gcmVtb3ZlIHRoZSBhc3NlcnQgdG9vLg0KDQpS ZXZpZXdlZC1ieTogQmFydCBWYW4gQXNzY2hlIDxiYXJ0LnZhbmFzc2NoZUB3ZGMuY29tPg0KDQo= --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Reviewed-by
#3 lore raw
In reply to a message not in the archive
Quoted 25 lines · Jason Gunthorpe

The very first thing free_res does is the same lock/signal/unlock sequence, so there is no reason to open code it before calling free_res.

res->sync_res always exists at this point so remove the assert too.

---
 srp_daemon/srp_daemon.c | 6 ------
 1 file changed, 6 deletions(-)

v3:
- Delete stray edit

Bart, Yes, must have been a stray editor edit, I did not even look at v2 in the mailer before sending it, since the one line change was so simple :( This one compiles.

srp_daemon/srp_daemon.c +0 -0
index cec36db2e0f12e..5995e6a6173046 100644
@@ -2073,12 +2073,6 @@ static int ibsrpdm(int argc, char *argv[])
 	if (ret)
 		pr_err("Querying SRP targets failed\n");

srp_daemon/srp_daemon.c static int ibsrpdm(int argc, char *argv[]) · line 2078

Quoted 10 lines
srp_daemon/srp_daemon.c +0 -6
 
-	assert(res->sync_res);
-	pthread_mutex_lock(&res->sync_res->retry_mutex);
-	res->sync_res->stop_threads = 1;
-	pthread_cond_signal(&res->sync_res->retry_cond);
-	pthread_mutex_unlock(&res->sync_res->retry_mutex);
-
 	free_res(res);
 umad_done:
 	umad_done();

thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html