From: Lee Jones <lee@kernel.org>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Christian Marangi <ansuelsmth@gmail.com>,
linux-leds@vger.kernel.org, Pavel Machek <pavel@ucw.cz>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] leds: leds-lp55xx: Convert mutex lock/unlock to guard API
Date: Thu, 27 Jun 2024 08:08:34 +0100 [thread overview]
Message-ID: <20240627070834.GC2532839@google.com> (raw)
In-Reply-To: <fa53fa80-4c0e-44d1-a62d-da219831526c@web.de>
On Thu, 27 Jun 2024, Markus Elfring wrote:
> > Convert any entry of mutex lock/unlock to guard API and simplify code.
>
> Thanks that you would like to support another bit of collateral evolution.
>
> * Would you get into the mood to benefit any more from applications
> of scope-based resource management?
>
> * Will development interests accordingly grow to adjust further source code places
> according to known pairs of function calls?
>
>
> > With the use of guard API, handling for selttest functions can be
>
> selftest?
>
>
> > greatly simplified.
>
> I find cover letters helpful for patch series.
>
>
> …
> > +++ b/drivers/leds/leds-lp5521.c
> > @@ -9,6 +9,7 @@
> > * Milo(Woogyom) Kim <milo.kim@ti.com>
> > */
> >
> > +#include <linux/cleanup.h>
> > #include <linux/delay.h>
> > #include <linux/firmware.h>
> …
>
> I guess that this proposed addition is not directly needed here (and related places)
> because the header file is included for the macro call “DEFINE_GUARD(mutex, …)” already.
> https://elixir.bootlin.com/linux/v6.10-rc5/source/include/linux/mutex.h#L22
>
>
> …
> > @@ -185,9 +186,9 @@ static ssize_t lp5521_selftest(struct device *dev,
> > struct lp55xx_chip *chip = led->chip;
> > int ret;
> >
> > - mutex_lock(&chip->lock);
> > + guard(mutex, &chip->lock);
> > +
> > ret = lp5521_run_selftest(chip, buf);
> > - mutex_unlock(&chip->lock);
> >
> > return sysfs_emit(buf, "%s\n", ret ? "FAIL" : "OK");
> > }
> …
>
> How do you think about to omit any blank lines (also at similar places)?
Please do not omit the blank lines.
--
Lee Jones [李琼斯]
next prev parent reply other threads:[~2024-06-27 7:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 22:15 [PATCH 1/3] leds: leds-lp5569: Convert to sysfs_emit API Christian Marangi
2024-06-26 22:15 ` [PATCH 2/3] leds: leds-lp5523: " Christian Marangi
2024-06-26 22:15 ` [PATCH 3/3] leds: leds-lp55xx: Convert mutex lock/unlock to guard API Christian Marangi
2024-06-27 5:52 ` Markus Elfring
2024-06-27 7:08 ` Lee Jones [this message]
2024-06-27 7:09 ` Lee Jones
2024-06-27 8:12 ` [3/3] " Markus Elfring
2024-06-27 8:22 ` Lee Jones
2024-06-27 9:24 ` Markus Elfring
2024-07-10 7:10 ` [PATCH 3/3] " Lee Jones
2024-07-10 16:24 ` Markus Elfring
2024-07-10 16:55 ` Lee Jones
2024-07-10 10:29 ` Christian Marangi
2024-07-10 18:10 ` [3/3] " Markus Elfring
2024-07-11 8:08 ` Lee Jones
2024-07-11 8:05 ` [PATCH 3/3] " Lee Jones
2024-07-04 15:44 ` [PATCH 1/3] leds: leds-lp5569: Convert to sysfs_emit API Lee Jones
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=20240627070834.GC2532839@google.com \
--to=lee@kernel.org \
--cc=Markus.Elfring@web.de \
--cc=ansuelsmth@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/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;
as well as URLs for NNTP newsgroup(s).