lkml.org 
[lkml]   [2020]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH v4 2/2] clk: Use devm_add in managed functions
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

\
 
 \ /
  Last update: 2020-03-02 11:14    [W:0.048 / U:3.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site