From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Marc Gonzalez <marc.w.gonzalez@free.fr>
Cc: Stephen Boyd <sboyd@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Russell King <linux@armlinux.org.uk>,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Robin Murphy <robin.murphy@arm.com>,
Arnd Bergmann <arnd@arndb.de>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rafael Wysocki <rjw@rjwysocki.net>,
Suzuki Poulose <suzuki.poulose@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
linux-clk <linux-clk@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v4 2/2] clk: Use devm_add in managed functions
Date: Mon, 2 Mar 2020 11:14:21 +0100 [thread overview]
Message-ID: <CAMuHMdVYghD_xLeXVFD+PGBKECSkQ+_KxPBwFmUDDO3W5skscQ@mail.gmail.com> (raw)
In-Reply-To: <7622db71-b1f4-62b4-86ee-78e00d5bd52c@free.fr>
Hi Marc,
On Mon, Mar 2, 2020 at 11:01 AM Marc Gonzalez <marc.w.gonzalez@free.fr> wrote:
> On 27/02/2020 14:36, Geert Uytterhoeven wrote:
> > On Wed, Feb 26, 2020 at 4:55 PM Marc Gonzalez <marc.w.gonzalez@free.fr> wrote:
> >> Using the helper produces simpler code, and smaller object size.
> >> --- a/drivers/clk/clk-devres.c
> >> +++ b/drivers/clk/clk-devres.c
> >> @@ -128,30 +109,22 @@ static int devm_clk_match(struct device *dev, void *res, void *data)
> >>
> >> void devm_clk_put(struct device *dev, struct clk *clk)
> >> {
> >> - int ret;
> >> -
> >> - ret = devres_release(dev, devm_clk_release, devm_clk_match, clk);
> >> -
> >> - WARN_ON(ret);
> >> + WARN_ON(devres_release(dev, my_clk_put, devm_clk_match, clk));
> >
> > Getting rid of "ret" is an unrelated change, which actually increases
> > kernel size, as the WARN_ON() parameter is stringified for the warning
> > message.
>
> Weird... Are you sure about that? I built the preprocessed file,
> and it didn't appear to be so.
>
> #ifndef WARN_ON
> #define WARN_ON(condition) ({ \
> int __ret_warn_on = !!(condition); \
> if (unlikely(__ret_warn_on)) \
> __WARN(); \
> unlikely(__ret_warn_on); \
> })
> #endif
>
> Maybe you were thinking of i915's WARN_ON?
>
> #define WARN_ON(x) WARN((x), "%s", "WARN_ON(" __stringify(x) ")")
Oops, you're right. I got trapped again by an override of a standard macro
(IMHO this should be removed).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
prev parent reply other threads:[~2020-03-02 10:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 15:44 [RFC PATCH v4 0/2] Small devm helper for devm implementations Marc Gonzalez
2020-02-26 15:49 ` [RFC PATCH v4 1/2] devres: Provide new helper for devm functions Marc Gonzalez
2020-02-27 13:28 ` Geert Uytterhoeven
2020-02-26 15:51 ` [RFC PATCH v4 2/2] clk: Use devm_add in managed functions Marc Gonzalez
2020-02-27 13:36 ` Geert Uytterhoeven
2020-03-02 10:01 ` Marc Gonzalez
2020-03-02 10:14 ` Geert Uytterhoeven [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=CAMuHMdVYghD_xLeXVFD+PGBKECSkQ+_KxPBwFmUDDO3W5skscQ@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=bjorn.andersson@linaro.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@roeck-us.net \
--cc=marc.w.gonzalez@free.fr \
--cc=mark.rutland@arm.com \
--cc=mturquette@baylibre.com \
--cc=rjw@rjwysocki.net \
--cc=robin.murphy@arm.com \
--cc=sboyd@kernel.org \
--cc=sudipm.mukherjee@gmail.com \
--cc=suzuki.poulose@arm.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;
as well as URLs for NNTP newsgroup(s).