From: "Nuno Sá" <noname.nuno@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Peng Wu <wupeng58@huawei.com>,
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 14:38:07 +0100 [thread overview]
Message-ID: <126c385f005958ac72662ac549c699623d44fdcd.camel@gmail.com> (raw)
In-Reply-To: <CAHp75VcpgrHz4MLmY+U=C74b=qpfipURJEbuTU6kn7RftdT_cA@mail.gmail.com>
On Fri, 2022-11-04 at 14:52 +0200, Andy Shevchenko wrote:
> On Fri, Nov 4, 2022 at 1:11 PM Nuno Sá <noname.nuno@gmail.com> wrote:
> > 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.
>
> Maybe simply
>
> /* Yes, we leave it locked here */
>
> before return 0; would suffice?
Yes, I think so...
- Nuno Sá
prev parent reply other threads:[~2022-11-04 13:36 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á
2022-11-04 12:52 ` Andy Shevchenko
2022-11-04 13:38 ` Nuno Sá [this message]
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=126c385f005958ac72662ac549c699623d44fdcd.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