From: Thomas Gleixner <tglx@linutronix.de>
To: Andre Renaud <andre@bluewatersys.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] [MTD] Casting bug in nand_default_block_markbad
Date: Sat, 14 Apr 2007 11:56:03 +0200 [thread overview]
Message-ID: <1176544564.3387.56.camel@localhost.localdomain> (raw)
In-Reply-To: <461C5290.6090202@bluewatersys.com>
On Wed, 2007-04-11 at 15:14 +1200, Andre Renaud wrote:
> There is a slight bug in nand_default_block_markbad, where the offset is
> cast to an integer, prior to being shifted. This means that on large
> offsets, it is incorrectly doing a signed shift & losing bits. Fixed
> this by doing the cast after the shift (as is done elsewhere in the code).
>
> Signed-off-by: Andre Renaud <andre@bluewatersys.com>
>
> Index: drivers/mtd/nand/nand_base.c
> ===================================================================
> --- drivers/mtd/nand/nand_base.c (revision 957)
> +++ drivers/mtd/nand/nand_base.c (working copy)
Please provide patches which can be applied with -p1, i.e. do the diff
one directory level up
> @@ -355,7 +355,7 @@
> int block, ret;
>
> /* Get block number */
> - block = ((int)ofs) >> chip->bbt_erase_shift;
> + block = (int)(ofs >> chip->bbt_erase_shift);
> if (chip->bbt)
> chip->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);
Also your patch is whitespace damaged and does not apply.
There is some HOWTO submit patches with Thunderbird somewhere in the
net.
I fix that up manually.
Thanks,
tglx
prev parent reply other threads:[~2007-04-14 9:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-11 3:14 [PATCH] [MTD] Casting bug in nand_default_block_markbad Andre Renaud
2007-04-14 9:56 ` Thomas Gleixner [this message]
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=1176544564.3387.56.camel@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=andre@bluewatersys.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