Re: [PATCH] brd: reduce the brd_devices_mutex scope

From
Christoph Hellwig <hch@lst.de>
Date
2021-09-07 06:50:02
Reply to
Tetsuo Handa, 2021-09-06
On Mon, Sep 06, 2021 at 09:47:54PM +0900, Tetsuo Handa wrote:
quoted hunk ↗ jump to hunk
+	mutex_lock(&brd_devices_mutex);
+	list_for_each_entry(brd, &brd_devices, brd_list) {
+		if (brd->brd_number != i)
+			continue;
+		mutex_unlock(&brd_devices_mutex);
+		return -EEXIST;
Nit:  I'd do this as:

		if (brd->brd_number == i) {
			mutex_unlock(&brd_devices_mutex);
			return -EEXIST;
		}

to flow a little nicer.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Thread (4 messages) 4 messages, 3 authors, last reply 2021-10-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help