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]
Date:   Fri, 13 Jan 2023 16:15:53 -0800
From:   Stephen Boyd <sboyd@...nel.org>
To:     Abel Vesa <abelvesa@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Michael Turquette <mturquette@...libre.com>,
        Oleksij Rempel <o.rempel@...gutronix.de>,
        Richard Cochran <richardcochran@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Shawn Guo <shawnguo@...nel.org>
Cc:     Oleksij Rempel <o.rempel@...gutronix.de>, kernel@...gutronix.de,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        Lee Jones <lee@...nel.org>,
        Russell King <linux@...linux.org.uk>,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-clk@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v1 04/20] ARM: imx6q: use of_clk_get_by_name() instead of_clk_get() to get ptp clock

Quoting Oleksij Rempel (2023-01-13 06:27:02)
> It is not clear from the code what clock should be taken. So, make sure it
> is readable and no other clock will be taken by accident.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> ---
>  arch/arm/mach-imx/mach-imx6q.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> index 7f6200925752..4885d3dfcf7f 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -98,7 +98,7 @@ static void __init imx6q_1588_init(void)
>         if (!IS_ERR(fec_enet_ref))
>                 goto put_node;
>  
> -       ptp_clk = of_clk_get(np, 2);
> +       ptp_clk = of_clk_get_by_name(np, "ptp");

The 'clocks' property in DTS should not be reordered. Order matters in
the binding. This patch makes the code do a string comparison (or a
few?) in the name of readability. Perhaps make a #define for '2' like
CLOCKS_PTP_INDEX, or just don't change it because it ain't broke.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ