[PATCH 2/6] MTD: xway: fix invalid operator

Boris Brezillon boris.brezillon at free-electrons.com
Tue Jun 7 02:28:26 PDT 2016


On Sun,  5 Jun 2016 23:20:05 +0200
Hauke Mehrtens <hauke at hauke-m.de> wrote:

> From: John Crispin <john at phrozen.org>
> 
> xway_read_byte should use a logic or and not an add operator when
> working out the NAND address. The NAND address bits are used to
> activate the pins to the NAND flash.
> 
> Signed-off-by: John Crispin <john at phrozen.org>
> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> ---
>  drivers/mtd/nand/xway_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/xway_nand.c b/drivers/mtd/nand/xway_nand.c
> index ccac19c..0ab6e83 100644
> --- a/drivers/mtd/nand/xway_nand.c
> +++ b/drivers/mtd/nand/xway_nand.c
> @@ -134,7 +134,7 @@ static unsigned char xway_read_byte(struct mtd_info *mtd)
>  	int ret;
>  
>  	spin_lock_irqsave(&ebu_lock, flags);
> -	ret = ltq_r8((void __iomem *)(nandaddr + NAND_READ_DATA));
> +	ret = ltq_r8((void __iomem *)(nandaddr | NAND_READ_DATA));

It's doing exactly the same, isn't it? What's the rationale behind this
change?

>  	spin_unlock_irqrestore(&ebu_lock, flags);
>  
>  	return ret;



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com



More information about the linux-mtd mailing list