All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Huang Shijie <b32955@freescale.com>
Cc: linux-mtd@lists.infradead.org, Gerhard Sittig <gsi@denx.de>,
	computersforpeace@gmail.com, dwmw2@infradead.org
Subject: Re: [PATCH] mtd: spi-nor: fix the wrong dummy value
Date: Thu, 17 Apr 2014 13:30:32 +0200	[thread overview]
Message-ID: <201404171330.32822.marex@denx.de> (raw)
In-Reply-To: <20140417045942.GB29495@localhost>

On Thursday, April 17, 2014 at 06:59:43 AM, Huang Shijie wrote:
> On Wed, Apr 16, 2014 at 10:08:49PM +0200, Gerhard Sittig wrote:
> > On Wed, 2014-04-16 at 16:18 +0800, Huang Shijie wrote:
> > > The dummy cycles is actually 8 for SPI fast/dual/quad read.
> > > 
> > > This patch fixes the wrong dummy value for both the spi-nor.c and
> > > m25p80.c.
> > > 
> > > Signed-off-by: Huang Shijie <b32955@freescale.com>
> > > ---
> > > 
> > >  drivers/mtd/devices/m25p80.c  |    3 +++
> > >  drivers/mtd/spi-nor/spi-nor.c |    2 +-
> > >  2 files changed, 4 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/drivers/mtd/devices/m25p80.c
> > > b/drivers/mtd/devices/m25p80.c index 1557d8f..112ca8b 100644
> > > --- a/drivers/mtd/devices/m25p80.c
> > > +++ b/drivers/mtd/devices/m25p80.c
> > > @@ -131,6 +131,9 @@ static int m25p80_read(struct spi_nor *nor, loff_t
> > > from, size_t len,
> > > 
> > >  	int dummy = nor->read_dummy;
> > >  	int ret;
> > > 
> > > +	/* convert the dummy cycles to the number of byte */
> > > +	dummy >>= 3;
> > > +
> > 
> > "dummy /= 8" to match the comment / commit message, and for
> > better mental association with a byte's width and the below
> > return value?
> 
> I first version is "dummy /= 8". but i think the "dummy >>= 3" is more
> faster.

You can prove that by running objdump on the object file and inspecting the 
generated code. My expectation would be that GCC would optimize this as needed.
[...]

Best regards,
Marek Vasut

  reply	other threads:[~2014-04-17 11:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16  8:18 [PATCH] mtd: spi-nor: fix the wrong dummy value Huang Shijie
2014-04-16 20:08 ` Gerhard Sittig
2014-04-17  4:59   ` Huang Shijie
2014-04-17 11:30     ` Marek Vasut [this message]
2014-04-17 13:41   ` Huang Shijie
2014-04-17 14:15     ` Marek Vasut
2014-04-17 15:55     ` Gerhard Sittig
2014-04-17 15:57       ` Huang Shijie
2014-04-17 18:12         ` Marek Vasut
2014-04-16 23:40 ` Marek Vasut
2014-04-17  5:01   ` Huang Shijie
2014-04-17 11:32     ` Marek Vasut
2014-04-17 12:59       ` Huang Shijie
2014-04-17 14:15         ` Marek Vasut

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=201404171330.32822.marex@denx.de \
    --to=marex@denx.de \
    --cc=b32955@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=gsi@denx.de \
    --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.