All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: John Crispin <blogic@openwrt.org>
Cc: David Woodhouse <dwmw2@infradead.org>, linux-mtd@lists.infradead.org
Subject: Re: [PATCH 1/6] MTD: lantiq: xway: fix invalid operator
Date: Mon, 4 Jan 2016 15:33:54 -0800	[thread overview]
Message-ID: <20160104233354.GB128501@google.com> (raw)
In-Reply-To: <1451941501-42952-2-git-send-email-blogic@openwrt.org>

On Mon, Jan 04, 2016 at 10:04:56PM +0100, John Crispin wrote:
> xway_read_byte should use a logic or and not an add operator when working
> out the nand address.

Why? It looks like a typical base address + offset use case. Or am I
missing something?

It would help if there was some kind of documentation, like the missing
DT doc that I mentioned on the cover letter, so I can know what the IO
mem range is supposed to be.

> Signed-off-by: John Crispin <blogic@openwrt.org>
> ---
>  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 3b28db4..81ec685 100644
> --- a/drivers/mtd/nand/xway_nand.c
> +++ b/drivers/mtd/nand/xway_nand.c
> @@ -124,7 +124,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));

This looks like odd code anyway; why all the casting? We have:

  void __iomem * --> unsigned long --> void __iomem *

Brian

>  	spin_unlock_irqrestore(&ebu_lock, flags);
>  
>  	return ret;
> -- 
> 1.7.10.4
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2016-01-04 23:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 21:04 [PATCH 0/6] MTD: lantiq: xway: various nand fixes John Crispin
2016-01-04 21:04 ` [PATCH 1/6] MTD: lantiq: xway: fix invalid operator John Crispin
2016-01-04 23:33   ` Brian Norris [this message]
2016-01-04 21:04 ` [PATCH 2/6] MTD: lantiq: xway: the latched command should be persistent John Crispin
2016-01-04 21:04 ` [PATCH 3/6] MTD: lantiq: xway: remove endless loop John Crispin
2016-01-04 23:39   ` Brian Norris
2016-01-04 21:04 ` [PATCH 4/6] MTD: lantiq: xway: add missing write_buf and read_buf to nand driver John Crispin
2016-01-04 23:35   ` Brian Norris
2016-01-04 23:45   ` Brian Norris
2016-01-04 21:05 ` [PATCH 5/6] MTD: lantiq: xway: fix nand locking John Crispin
2016-01-04 23:36   ` Brian Norris
2016-01-04 21:05 ` [PATCH 6/6] MTD: lantiq: xway: allow request line masking John Crispin
2016-01-04 23:37   ` Brian Norris
2016-01-04 23:30 ` [PATCH 0/6] MTD: lantiq: xway: various nand fixes Brian Norris
2016-01-05  7:34   ` John Crispin
2016-01-05 17:53     ` Brian Norris
2016-01-05 18:44       ` John Crispin
2016-01-05 18:55         ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160104233354.GB128501@google.com \
    --to=computersforpeace@gmail.com \
    --cc=blogic@openwrt.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.