From: Thomas Gleixner <tglx@linutronix.de>
To: "Knobloch, Thomas" <knobloch@siemens.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] [MTD] NAND: Wrong calculation of page number in nand_block_bad()
Date: Fri, 27 Apr 2007 19:03:51 +0200 [thread overview]
Message-ID: <1177693431.25960.123.camel@localhost.localdomain> (raw)
In-Reply-To: <2EDADF4ED023F04BAD4D7A4131ECEB930105527C@mchp7rfa.ww002.siemens.net>
On Fri, 2007-04-27 at 13:19 +0200, Knobloch, Thomas wrote:
> In case that there is no memory based bad block table available the
> function nand_block_checkbad() in drivers/mtd/nand/nand_base.c will call
> nand_block_bad() directly. When parameter 'getchip' is set to zero,
> nand_block_bad() will not right shift the offset to calculate the
> correct page number.
>
> Signed-off-by: Thomas Knobloch <knobloch@siemens.com>
>
> diff -uNr a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> --- a/drivers/mtd/nand/nand_base.c 2007-04-27 12:44:23.345198284
> +0200
> +++ b/drivers/mtd/nand/nand_base.c 2007-04-27 12:46:57.916226928
> +0200
> @@ -312,7 +312,7 @@
> /* Select the NAND device */
> chip->select_chip(mtd, chipnr);
> } else
> - page = (int)ofs;
> + page = (int)(ofs >> chip->page_shift);
Can you please make this outside the else path, so we can remove same
code in the if (getchip) path.
Please also apply the pagemask right there so we don't have it in both
cmdfunc() calls.
tglx
next prev parent reply other threads:[~2007-04-27 17:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-27 11:19 [PATCH] [MTD] NAND: Wrong calculation of page number in nand_block_bad() Knobloch, Thomas
2007-04-27 17:03 ` Thomas Gleixner [this message]
2007-05-02 12:14 ` AW: [PATCH] [MTD] NAND: Wrong calculation of page number innand_block_bad() Knobloch, Thomas
2007-05-02 15:18 ` Thomas Gleixner
2007-05-02 17:48 ` Thomas Knobloch
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=1177693431.25960.123.camel@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=knobloch@siemens.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox