From: Nishanth Menon <nm@ti.com>
To: Kamlesh Gurudasani <kamlesh@ti.com>
Cc: "Kumar, Udit" <u-kumar1@ti.com>, <kristo@kernel.org>,
<ssantosh@kernel.org>, <chandru@ti.com>, <rishabh@ti.com>,
<vigneshr@ti.com>, <mturquette@baylibre.com>, <sboyd@kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linux-clk@vger.kernel.org>
Subject: Re: [PATCH v3] clk: keystone: sci-clk: Adding support for non contiguous clocks
Date: Fri, 9 Feb 2024 13:02:27 -0600 [thread overview]
Message-ID: <20240209190227.lboi6n5s2oy7kxgc@pristine> (raw)
In-Reply-To: <87y1btlb66.fsf@kamlesh.i-did-not-set--mail-host-address--so-tickle-me>
On 00:25-20240210, Kamlesh Gurudasani wrote:
> >> > >
> >> > > diff --git a/drivers/clk/keystone/sci-clk.c b/drivers/clk/keystone/sci-clk.c
> >> > > index 35fe197dd303..31b7df05d7bb 100644
> >> > > --- a/drivers/clk/keystone/sci-clk.c
> >> > > +++ b/drivers/clk/keystone/sci-clk.c
> >> > > @@ -516,6 +516,7 @@ static int ti_sci_scan_clocks_from_dt(struct sci_clk_provider *provider)
> >> > > struct sci_clk *sci_clk, *prev;
> >> > > int num_clks = 0;
> >> > > int num_parents;
> >> > > [..] /* Check if this clock id is valid */
> >> > > + ret = provider->ops->is_auto(provider->sci,
> >> > > + sci_clk->dev_id, ++clk_id, &state);
> >> > A bit too nice coding ;) => I had been confused momentarily by clk_id = args.args[1]
> >> > change just above till I saw that you are pre-incrementing
> >> > clk_id - Is there a harm in leaving the original clk_id increment logic
> >> > alone (it was much simpler to read up)?
> >>
> >> No warm in using original code but want to avoid, two statement for
> >> increment in case of failure and success.
> >>
> >> Let me know, if i need to add few comments around this
> >>
> >> or if you think, code is confusing I can move to original one
> >
> > Yes, please drop the un-necessary changes. In this case, original
> > increment code should work just fine.
> I wouldn't call it unnecessary, If I have to track increment/addition at
> 3 different places just to understand the loop, it is hard. On other
> hand, pre-increment code is solving the problem by having increment at
> only one place(easier to track). On the plus side, every clk_id belonging to
> parent is handled completely inside the loop.
>
> For a new person looking at this code, pre-increment code would be
> actually easier to undertsand.
>
> Also, Udit feels the same.
>
> Would you please explain why do you think the original increment code
> make more sense? It's not simple to understand or track, that's for sure.
the context of the fix is the is_auto call to know what parent options
are valid or not. Do the absolutely what is necessary in the change. if
you want to beautify etc, move it to some other patch and debate about
it. So, this is un-necessary change in this patch.
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-02-09 19:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-07 9:11 [PATCH v3] clk: keystone: sci-clk: Adding support for non contiguous clocks Udit Kumar
2024-02-07 9:53 ` Kamlesh Gurudasani
2024-02-07 12:54 ` Nishanth Menon
2024-02-07 13:45 ` Kamlesh Gurudasani
2024-02-07 14:23 ` Kumar, Udit
2024-02-09 17:25 ` Nishanth Menon
2024-02-09 18:55 ` Kamlesh Gurudasani
2024-02-09 19:02 ` Nishanth Menon [this message]
2024-02-09 20:01 ` Kamlesh Gurudasani
2024-02-11 15:54 ` Francesco Dolcini
2024-02-12 4:36 ` Kumar, Udit
2024-02-12 7:58 ` Francesco Dolcini
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=20240209190227.lboi6n5s2oy7kxgc@pristine \
--to=nm@ti.com \
--cc=chandru@ti.com \
--cc=kamlesh@ti.com \
--cc=kristo@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=rishabh@ti.com \
--cc=sboyd@kernel.org \
--cc=ssantosh@kernel.org \
--cc=u-kumar1@ti.com \
--cc=vigneshr@ti.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