All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@lazybastard.org>
To: Felix Fietkau <nbd@openwrt.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] block2mtd oops in erase function.
Date: Mon, 19 Feb 2007 22:30:24 +0000	[thread overview]
Message-ID: <20070219223023.GF7813@lazybastard.org> (raw)
In-Reply-To: <20070219222041.GE7813@lazybastard.org>

On Mon, 19 February 2007 22:20:41 +0000, Jörn Engel wrote:
> 
> The proper fix would be to remove the cast instead of adding yet
> another.  I wonder when those got added.

On December 21st 2004 by none other than me.  How embarrassing!
http://lists.infradead.org/pipermail/linux-mtd/2004-December/011236.html

Can you test this patch?

diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index f9f2ce7..6a9fb80 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -111,8 +111,8 @@ static int _block2mtd_erase(struct block
 		if (IS_ERR(page))
 			return PTR_ERR(page);
 
-		max = (u_long*)page_address(page) + PAGE_SIZE;
-		for (p=(u_long*)page_address(page); p<max; p++)
+		max = page_address(page) + PAGE_SIZE;
+		for (p=page_address(page); p<max; p++)
 			if (*p != -1UL) {
 				lock_page(page);
 				memset(page_address(page), 0xff, PAGE_SIZE);

Jörn

-- 
"[One] doesn't need to know [...] how to cause a headache in order
to take an aspirin."
-- Scott Culp, Manager of the Microsoft Security Response Center, 2001

  reply	other threads:[~2007-02-19 22:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-19 21:29 [PATCH] block2mtd oops in erase function Felix Fietkau
2007-02-19 22:20 ` Jörn Engel
2007-02-19 22:30   ` Jörn Engel [this message]
2007-02-20  2:27     ` Felix Fietkau
2007-02-20 10:53       ` Jörn Engel
2007-02-20 21:35         ` Jason Lunz
2007-02-20 21:55           ` Jörn Engel
     [not found]             ` <20070221030254.GA11044@avocado.homenet>
2007-02-21 14:47               ` Jörn Engel
2007-02-21 15:42                 ` Jason Lunz
2007-02-21 16:02                   ` Jörn Engel
2007-02-21 20:26                     ` Jason Lunz
2007-02-21 21:43                       ` Jörn Engel

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=20070219223023.GF7813@lazybastard.org \
    --to=joern@lazybastard.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nbd@openwrt.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.