Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH] pinctrl: renesas: rzn1: Use for_each_child_of_node_scoped()
Date: Fri, 31 May 2024 11:01:40 +0300	[thread overview]
Message-ID: <7f4ef893-5ab6-4a9e-ad54-4b3587516bcf@moroto.mountain> (raw)
In-Reply-To: <CAHp75Vd3ke3_bxwsxzSVzjnNW-6aYDTYHvZ-+B9nJtAJR1fX=g@mail.gmail.com>

On Thu, May 30, 2024 at 04:36:59PM +0300, Andy Shevchenko wrote:
> On Thu, May 30, 2024 at 2:52 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Thu, May 30, 2024 at 11:26 AM Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> > > Thu, May 30, 2024 at 11:19:29AM +0200, Geert Uytterhoeven kirjoitti:
> > > > Use the scoped variant of for_each_child_of_node() to simplify the code.
> > >
> > > I do not see the point of this patch. This makes code actually more
> > > complicated, and I'm not sure the code generation is the same and not worse.
> >
> > On arm32, a conversion to for_each_child_of_node_scoped() seems to
> > cost ca. 48 bytes of additional code.
> >
> > BTW, the same is true for cases where the conversion does simplify
> > cleanup.
> >
> > I checked "pinctrl: renesas: Use scope based of_node_put() cleanups",
> > and all but the conversions in *_dt_node_to_map() cost 48 bytes each.
> 
> Yeah. so for the cases where there are no returns from inside the loop
> I prefer not to use _scoped.

Eventually _scoped() loops will become the norm.  Leaving some unscoped
loops will be a fun surprise for the first person to introduce a return
-EINVAL.

regards,
dan carpenter

  reply	other threads:[~2024-05-31  8:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30  9:19 [PATCH] pinctrl: renesas: rzn1: Use for_each_child_of_node_scoped() Geert Uytterhoeven
2024-05-30  9:26 ` Andy Shevchenko
2024-05-30 11:52   ` Geert Uytterhoeven
2024-05-30 13:36     ` Andy Shevchenko
2024-05-31  8:01       ` Dan Carpenter [this message]
2024-05-31  8:19         ` Andy Shevchenko
2024-05-31  9:18           ` Dan Carpenter
2024-06-07 12:08         ` Geert Uytterhoeven

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=7f4ef893-5ab6-4a9e-ad54-4b3587516bcf@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /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