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] [day] [month] [year] [list]
Date:	Mon, 23 Nov 2015 19:05:52 +0100
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Saurabh Sengar <saurabh.truth@...il.com>
Cc:	Måns Rullgård <mans@...sr.com>,
	David Woodhouse <dwmw2@...radead.org>,
	Brian Norris <computersforpeace@...il.com>,
	MTD Maling List <linux-mtd@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] mtd: nand: use of_property_read_u8()

Hi Saurab,

On Mon, Nov 23, 2015 at 5:15 PM, Saurabh Sengar <saurabh.truth@...il.com> wrote:
> use of_property_read_u8() for u8 values

Why are you making this change?
Have you tested this?

drivers/of/base.c says

     * dts entry of array should be like:
     *      property = /bits/ 8 <0x50 0x60 0x70>;

but Documentation/devicetree/bindings/mtd/orion-nand.txt doesn't say
anything about the "/bits/ 8" part, thus "normal" 32-bit cells are assumed.

> Signed-off-by: Saurabh Sengar <saurabh.truth@...il.com>
> ---
> v2 :  added the missed semi colon
>  drivers/mtd/nand/orion_nand.c | 22 +++++++---------------
>  1 file changed, 7 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index ee83749..0cbebc5 100644
>
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -83,7 +83,6 @@ static int __init orion_nand_probe(struct platform_device *pdev)
>         struct clk *clk;
>         void __iomem *io_base;
>         int ret = 0;
> -       u32 val = 0;
>
>         nc = devm_kzalloc(&pdev->dev,
>                         sizeof(struct nand_chip) + sizeof(struct mtd_info),
> @@ -103,22 +102,15 @@ static int __init orion_nand_probe(struct platform_device *pdev)
>                                         GFP_KERNEL);
>                 if (!board)
>                         return -ENOMEM;
> -               if (!of_property_read_u32(pdev->dev.of_node, "cle", &val))
> -                       board->cle = (u8)val;
> -               else
> -                       board->cle = 0;
> -               if (!of_property_read_u32(pdev->dev.of_node, "ale", &val))
> -                       board->ale = (u8)val;
> -               else
> +               of_property_read_u8(pdev->dev.of_node, "cle", &board->cle);
> +
> +               if (of_property_read_u8(pdev->dev.of_node, "ale", &board->ale))
>                         board->ale = 1;
> -               if (!of_property_read_u32(pdev->dev.of_node,
> -                                               "bank-width", &val))
> -                       board->width = (u8)val * 8;
> -               else
> +               if (of_property_read_u8(pdev->dev.of_node,
> +                                               "bank-width", &board->width))
>                         board->width = 8;
> -               if (!of_property_read_u32(pdev->dev.of_node,
> -                                               "chip-delay", &val))
> -                       board->chip_delay = (u8)val;
> +               of_property_read_u8(pdev->dev.of_node,
> +                                       "chip-delay", &board->chip_delay);

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ