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: <CAAQ0ZWT3ovG7eKZZuoSZkx4FGd+W9XvnTk8R1yuD02u4wqGNHQ@mail.gmail.com>
Date:	Wed, 27 Jun 2012 19:26:07 +0800
From:	Shawn Guo <shawn.guo@...aro.org>
To:	Marc Kleine-Budde <mkl@...gutronix.de>
Cc:	davem@...emloft.net, netdev@...r.kernel.org,
	linux-can@...r.kernel.org, Hui Wang <jason77.wang@...il.com>
Subject: Re: [PATCH] can: flexcan: use be32_to_cpup to handle the value of dt entry

On 27 June 2012 17:27, Marc Kleine-Budde <mkl@...gutronix.de> wrote:
> From: Hui Wang <jason77.wang@...il.com>
>
> The freescale arm i.MX series platform can support this driver, and
> usually the arm cpu works in the little endian mode by default, while
> device tree entry value is stored in big endian format, we should use
> be32_to_cpup() to handle them, after modification, it can work well
> both on the le cpu and be cpu.
>
I'm wondering if you want to just use of_property_read_u32() to make
it a little bit easier.

Regards,
Shawn

> Cc: stable <stable@...r.kernel.org> # v3.2+
> Cc: Shawn Guo <shawn.guo@...aro.org>
> Signed-off-by: Hui Wang <jason77.wang@...il.com>
> Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
> ---
>  drivers/net/can/flexcan.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index 38c0690..81d4741 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -939,12 +939,12 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
>                return PTR_ERR(pinctrl);
>
>        if (pdev->dev.of_node) {
> -               const u32 *clock_freq_p;
> +               const __be32 *clock_freq_p;
>
>                clock_freq_p = of_get_property(pdev->dev.of_node,
>                                                "clock-frequency", NULL);
>                if (clock_freq_p)
> -                       clock_freq = *clock_freq_p;
> +                       clock_freq = be32_to_cpup(clock_freq_p);
>        }
>
>        if (!clock_freq) {
> --
> 1.7.10
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ