From: Marijn Suijten <marijn.suijten@somainline.org> To: Stephen Boyd <sboyd@kernel.org> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>, Konrad Dybcio <konrad.dybcio@somainline.org>, Martin Botka <martin.botka@somainline.org>, Jami Kettunen <jami.kettunen@somainline.org>, Michael Turquette <mturquette@baylibre.com>, Rob Clark <robdclark@gmail.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>, Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Rajeev Nandan <quic_rajeevny@quicinc.com>, Vladimir Lypak <vladimir.lypak@gmail.com>, Arnd Bergmann <arnd@arndb.de>, Jonathan Marek <jonathan@marek.ca>, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: Re: [PATCH v2 03/11] clk: fixed-factor: Introduce *clk_hw_register_fixed_factor_parent_hw() Date: Fri, 10 Jun 2022 09:46:32 +0200 [thread overview] Message-ID: <20220610074632.abtec5kulbclund4@SoMainline.org> (raw) In-Reply-To: <20220609221211.684C1C34114@smtp.kernel.org> 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@somainline.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
WARNING: multiple messages have this Message-ID (diff)
From: Marijn Suijten <marijn.suijten@somainline.org> To: Stephen Boyd <sboyd@kernel.org> Cc: David Airlie <airlied@linux.ie>, Michael Turquette <mturquette@baylibre.com>, Konrad Dybcio <konrad.dybcio@somainline.org>, dri-devel@lists.freedesktop.org, AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>, phone-devel@vger.kernel.org, linux-clk@vger.kernel.org, Jonathan Marek <jonathan@marek.ca>, linux-arm-msm@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>, Rajeev Nandan <quic_rajeevny@quicinc.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>, Martin Botka <martin.botka@somainline.org>, ~postmarketos/upstreaming@lists.sr.ht, Sean Paul <sean@poorly.run>, Jami Kettunen <jami.kettunen@somainline.org>, Vladimir Lypak <vladimir.lypak@gmail.com>, linux-kernel@vger.kernel.org, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, freedreno@lists.freedesktop.org Subject: Re: [PATCH v2 03/11] clk: fixed-factor: Introduce *clk_hw_register_fixed_factor_parent_hw() Date: Fri, 10 Jun 2022 09:46:32 +0200 [thread overview] Message-ID: <20220610074632.abtec5kulbclund4@SoMainline.org> (raw) In-Reply-To: <20220609221211.684C1C34114@smtp.kernel.org> 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@somainline.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
next prev parent reply other threads:[~2022-06-10 7:46 UTC|newest] Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-01 22:07 [PATCH v2 00/11] drm/msm/dsi_phy: Replace parent names with clk_hw pointers Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-01 22:07 ` [PATCH v2 01/11] clk: divider: Introduce devm_clk_hw_register_divider_parent_hw() Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-02 10:14 ` Dmitry Baryshkov 2022-06-02 10:14 ` Dmitry Baryshkov 2022-06-01 22:07 ` [PATCH v2 02/11] clk: mux: Introduce devm_clk_hw_register_mux_parent_hws() Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-02 10:15 ` Dmitry Baryshkov 2022-06-02 10:15 ` Dmitry Baryshkov 2022-06-01 22:07 ` [PATCH v2 03/11] clk: fixed-factor: Introduce *clk_hw_register_fixed_factor_parent_hw() Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-02 10:20 ` Dmitry Baryshkov 2022-06-02 10:20 ` Dmitry Baryshkov 2022-06-09 22:12 ` Stephen Boyd 2022-06-09 22:12 ` Stephen Boyd 2022-06-10 7:46 ` Marijn Suijten [this message] 2022-06-10 7:46 ` Marijn Suijten 2022-06-10 19:01 ` Stephen Boyd 2022-06-10 19:01 ` Stephen Boyd 2022-06-27 22:36 ` Marijn Suijten 2022-06-27 22:36 ` Marijn Suijten 2022-06-01 22:07 ` [PATCH v2 04/11] drm/msm/dsi/phy: Reindent and reflow multiline function calls Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-02 10:14 ` Dmitry Baryshkov 2022-06-02 10:14 ` Dmitry Baryshkov 2022-06-10 7:35 ` Marijn Suijten 2022-06-10 7:35 ` Marijn Suijten 2022-06-01 22:07 ` [PATCH v2 05/11] drm/msm/dsi_phy_28nm_8960: Use stack memory for temporary clock names Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-01 22:07 ` [PATCH v2 06/11] drm/msm/dsi/phy: Replace hardcoded char-array length with sizeof() Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-02 9:41 ` Dmitry Baryshkov 2022-06-02 9:41 ` Dmitry Baryshkov 2022-06-01 22:07 ` [PATCH v2 07/11] drm/msm/dsi_phy_28nm_8960: Replace parent names with clk_hw pointers Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-01 22:07 ` [PATCH v2 08/11] drm/msm/dsi_phy_28nm: " Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-02 9:41 ` Dmitry Baryshkov 2022-06-02 9:41 ` Dmitry Baryshkov 2022-06-01 22:07 ` [PATCH v2 09/11] drm/msm/dsi_phy_14nm: " Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-01 22:07 ` [PATCH v2 10/11] drm/msm/dsi_phy_10nm: " Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten 2022-06-01 22:07 ` [PATCH v2 11/11] drm/msm/dsi_phy_7nm: " Marijn Suijten 2022-06-01 22:07 ` Marijn Suijten
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=20220610074632.abtec5kulbclund4@SoMainline.org \ --to=marijn.suijten@somainline.org \ --cc=airlied@linux.ie \ --cc=angelogioacchino.delregno@somainline.org \ --cc=arnd@arndb.de \ --cc=daniel@ffwll.ch \ --cc=dmitry.baryshkov@linaro.org \ --cc=dri-devel@lists.freedesktop.org \ --cc=freedreno@lists.freedesktop.org \ --cc=jami.kettunen@somainline.org \ --cc=jonathan@marek.ca \ --cc=konrad.dybcio@somainline.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-clk@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=martin.botka@somainline.org \ --cc=mturquette@baylibre.com \ --cc=phone-devel@vger.kernel.org \ --cc=quic_abhinavk@quicinc.com \ --cc=quic_rajeevny@quicinc.com \ --cc=robdclark@gmail.com \ --cc=sboyd@kernel.org \ --cc=sean@poorly.run \ --cc=vladimir.lypak@gmail.com \ --cc=~postmarketos/upstreaming@lists.sr.ht \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.