lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqJ0O=-vNqSUjgr_Po=Xy1G+7Zdz7Dz+euUDjcpBAqtGqA@mail.gmail.com>
Date:   Fri, 6 Oct 2023 17:58:33 -0500
From:   Rob Herring <robh@...nel.org>
To:     Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Cc:     Charles Keepax <ckeepax@...nsource.cirrus.com>,
        Richard Fitzgerald <rf@...nsource.cirrus.com>,
        Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>,
        David Lechner <david@...hnology.com>,
        Sekhar Nori <nsekhar@...com>, Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        Heiko Stuebner <heiko@...ech.de>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Sylwester Nawrocki <s.nawrocki@...sung.com>,
        Tomasz Figa <tomasz.figa@...il.com>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Tero Kristo <kristo@...nel.org>, patches@...nsource.cirrus.com,
        linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-rockchip@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org, linux-omap@...r.kernel.org
Subject: Re: [PATCH] clk: Use device_get_match_data()

On Fri, Oct 6, 2023 at 5:10 PM Dmitry Baryshkov
<dmitry.baryshkov@...aro.org> wrote:
>
> On Sat, 7 Oct 2023 at 00:41, Rob Herring <robh@...nel.org> wrote:
> >
> > Use preferred device_get_match_data() instead of of_match_device() to
> > get the driver match data. With this, adjust the includes to explicitly
> > include the correct headers.
> >
> > Signed-off-by: Rob Herring <robh@...nel.org>
> > ---
> >  drivers/clk/clk-lochnagar.c             |  9 ++-------
> >  drivers/clk/davinci/da8xx-cfgchip.c     |  8 +++-----
> >  drivers/clk/davinci/pll.c               | 10 +++-------
> >  drivers/clk/davinci/psc.c               | 10 +++-------
> >  drivers/clk/qcom/gcc-msm8960.c          | 13 +++++--------
> >  drivers/clk/qcom/gcc-msm8974.c          | 10 +++-------
> >  drivers/clk/qcom/kpss-xcc.c             |  9 ++-------
> >  drivers/clk/qcom/krait-cc.c             | 14 +++++---------
> >  drivers/clk/qcom/mmcc-msm8960.c         | 16 +++++-----------
> >  drivers/clk/qcom/mmcc-sdm660.c          |  8 ++------
> >  drivers/clk/rockchip/clk-rk3399.c       |  9 ++-------
> >  drivers/clk/samsung/clk-exynos-clkout.c |  8 +++-----
> >  drivers/clk/ti/adpll.c                  | 14 ++++----------
> >  13 files changed, 42 insertions(+), 96 deletions(-)
> >

> > diff --git a/drivers/clk/qcom/mmcc-msm8960.c b/drivers/clk/qcom/mmcc-msm8960.c
> > index 6bf908a51f53..50638ab341ec 100644
> > --- a/drivers/clk/qcom/mmcc-msm8960.c
> > +++ b/drivers/clk/qcom/mmcc-msm8960.c
> > @@ -8,9 +8,9 @@
> >  #include <linux/err.h>
> >  #include <linux/delay.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/property.h>
> >  #include <linux/module.h>
> >  #include <linux/of.h>
> > -#include <linux/of_device.h>
> >  #include <linux/clk.h>
> >  #include <linux/clk-provider.h>
> >  #include <linux/regmap.h>
> > @@ -3105,30 +3105,24 @@ MODULE_DEVICE_TABLE(of, mmcc_msm8960_match_table);
> >
> >  static int mmcc_msm8960_probe(struct platform_device *pdev)
> >  {
> > -       const struct of_device_id *match;
> >         struct regmap *regmap;
> > -       bool is_8064;
> >         struct device *dev = &pdev->dev;
> > +       const struct qcom_cc_desc *desc = device_get_match_data(dev);
> >
> > -       match = of_match_device(mmcc_msm8960_match_table, dev);
> > -       if (!match)
> > -               return -EINVAL;
> > -
> > -       is_8064 = of_device_is_compatible(dev->of_node, "qcom,mmcc-apq8064");
>
> Can we please keep of_device_is_compatible here? It is more explicit
> and self-documenting.

Why do we need to match 3 times (match, device_get_match_data,
of_device_is_compatible)?

Perhaps put it in the match data? Or make a helper function is_8064()
that does the comparison to the match data?

> Also, it would be really nice to have per-platform patches, so that
> our maintainers can pick them, otherwise the risk of conflicts is
> pretty high.

No.

I'm doing this treewide. It's already pretty unmanageable. But feel
free to submit a separate patch if you prefer to this for QCom. When I
split things up by sub-arch, then I also have to spend time chasing
down non-responsive maintainers.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ