All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	linux-block <linux-block@vger.kernel.org>
Subject: Re: [PATCH] brd: reduce the brd_devices_mutex scope
Date: Tue, 7 Sep 2021 08:49:58 +0200	[thread overview]
Message-ID: <20210907064958.GA29211@lst.de> (raw)
In-Reply-To: <65b57a74-34db-d466-df67-c7a7bb529ae3@i-love.sakura.ne.jp>

On Mon, Sep 06, 2021 at 09:47:54PM +0900, Tetsuo Handa wrote:
> +	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>

  reply	other threads:[~2021-09-07  6:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 12:47 [PATCH] brd: reduce the brd_devices_mutex scope Tetsuo Handa
2021-09-07  6:49 ` Christoph Hellwig [this message]
2021-09-07 10:18   ` [PATCH v2] " Tetsuo Handa
2021-10-17 12:52     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210907064958.GA29211@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.