From: "Nuno Sá" <noname.nuno@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
Peng Wu <wupeng58@huawei.com>
Cc: jic23@kernel.org, lars@metafoo.de, nuno.sa@analog.com,
linux-iio@vger.kernel.org, liwei391@huawei.com
Subject: Re: [PATCH -next] iio: core: fix missing mutex_unlock() in iio_device_claim_buffer_mode()
Date: Fri, 04 Nov 2022 12:13:06 +0100 [thread overview]
Message-ID: <d46af04a6bd6373286a18a6f71aebd2c6aafd93a.camel@gmail.com> (raw)
In-Reply-To: <CAHp75Vd_h3Avyafefg0fj-2BMCqvAH4U3Fd3biTptMMZdo_c2g@mail.gmail.com>
On Fri, 2022-11-04 at 11:54 +0200, Andy Shevchenko wrote:
> On Fri, Nov 4, 2022 at 11:05 AM Peng Wu <wupeng58@huawei.com> wrote:
> >
> > In the success path of iio_device_claim_buffer_mode(),
> > mutex_unlock()
> > should be called before return.
>
> Please, understand how the code works.
> NAK.
>
> Nuno, perhaps we need to put a comment inside the function to explain
> this?
>
Hmm... I guess we can do that but, honestly, the docs in the function
should be pretty straight. Maybe saying that it's supposed to work as
iio_device_claim_direct_mode() would help (as that one is familiar)...
Alternatively, having sparse annotations could also make it more easy
to understand the intent.
- Nuno Sá
next prev parent reply other threads:[~2022-11-04 11:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 9:03 [PATCH -next] iio: core: fix missing mutex_unlock() in iio_device_claim_buffer_mode() Peng Wu
2022-11-04 9:54 ` Andy Shevchenko
2022-11-04 11:13 ` Nuno Sá [this message]
2022-11-04 12:52 ` Andy Shevchenko
2022-11-04 13:38 ` Nuno Sá
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=d46af04a6bd6373286a18a6f71aebd2c6aafd93a.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=liwei391@huawei.com \
--cc=nuno.sa@analog.com \
--cc=wupeng58@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox