[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220610074632.abtec5kulbclund4@SoMainline.org>
Date: Fri, 10 Jun 2022 09:46:32 +0200
From: Marijn Suijten <marijn.suijten@...ainline.org>
To: Stephen Boyd <sboyd@...nel.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
phone-devel@...r.kernel.org, ~postmarketos/upstreaming@...ts.sr.ht,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...ainline.org>,
Konrad Dybcio <konrad.dybcio@...ainline.org>,
Martin Botka <martin.botka@...ainline.org>,
Jami Kettunen <jami.kettunen@...ainline.org>,
Michael Turquette <mturquette@...libre.com>,
Rob Clark <robdclark@...il.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Sean Paul <sean@...rly.run>, David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Rajeev Nandan <quic_rajeevny@...cinc.com>,
Vladimir Lypak <vladimir.lypak@...il.com>,
Arnd Bergmann <arnd@...db.de>,
Jonathan Marek <jonathan@...ek.ca>, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org
Subject: Re: [PATCH v2 03/11] clk: fixed-factor: Introduce
*clk_hw_register_fixed_factor_parent_hw()
On 2022-06-09 15:12:09, Stephen Boyd wrote:
> Quoting Dmitry Baryshkov (2022-06-02 03:20:19)
> > On Thu, 2 Jun 2022 at 01:07, Marijn Suijten
> > <marijn.suijten@...ainline.org> wrote:
> > > diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
> > > index 54942d758ee6..fabb98d0cdb2 100644
> > > --- a/drivers/clk/clk-fixed-factor.c
> > > +++ b/drivers/clk/clk-fixed-factor.c
> > > @@ -78,7 +78,8 @@ static void devm_clk_hw_register_fixed_factor_release(struct device *dev, void *
> > >
> > > static struct clk_hw *
> > > __clk_hw_register_fixed_factor(struct device *dev, struct device_node *np,
> > > - const char *name, const char *parent_name, int index,
> > > + const char *name, const char *parent_name,
> > > + const struct clk_hw *parent_hw, int index,
> > > unsigned long flags, unsigned int mult, unsigned int div,
> > > bool devm)
> > > {
> > > @@ -108,7 +109,9 @@ __clk_hw_register_fixed_factor(struct device *dev, struct device_node *np,
> > > init.name = name;
> > > init.ops = &clk_fixed_factor_ops;
> > > init.flags = flags;
> > > - if (parent_name)
> > > + if (parent_hw)
> > > + init.parent_hws = &parent_hw;
> > > + else if (parent_name)
> > > init.parent_names = &parent_name;
> >
> > If you change the order of if clauses, you won't have to introduce
> > unnecessary changes.
>
> Indeed, please do that.
The intent here was to prefer parent_hw over parent_name, but I later
reordered the function arguments again to have parent_name before
parent_hw; in-line with __clk_hw_register_divider. Hence makes more
sense to swap these around indeed.
Besides, we don't expect more than one of these to be set anyway per
design of this private function, that is only called by well-defined
implementations below.
> >
> > > else
> > > init.parent_data = &pdata;
> > > @@ -148,17 +151,50 @@ struct clk_hw *devm_clk_hw_register_fixed_factor_index(struct device *dev,
> > > const char *name, unsigned int index, unsigned long flags,
> > > unsigned int mult, unsigned int div)
> > > {
> > > - return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, index,
> > > - flags, mult, div, true);
> > > + return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, NULL,
> > > + index, flags, mult, div, true);
> >
> > Here (and several times later) you are inserting an argument and then
> > moving arguments to the next line. My slight preference would be to
> > just insert the arg (and maybe break the line if it gets too long) w/o
> > touching the next lines.
That'll definitely look odd, as we'll end up with index floating on a
single line, all on its own.
> I'd just add the argument at the end because when it is added in the
> middle it makes the diff more difficult to read.
How strong is this feeling, against keeping argument ordering consistent
with other implementations of similar __clk_hw_register_* functions?
- Marijn
Powered by blists - more mailing lists