From: unsik Kim <donari75@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-BOOT][PATCH 2/4] mflash : Fix uncorrect mask operation
Date: Wed, 18 Feb 2009 19:51:45 +0900 [thread overview]
Message-ID: <499BE841.4080002@gmail.com> (raw)
Signed-off-by: unsik Kim <donari75@gmail.com>
---
drivers/block/mg_disk.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 26b6a80..1f9debe 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -385,7 +385,7 @@ unsigned int mg_disk_read (u32 addr, u8 *buff, u32 len)
if (cur_addr < end_addr) {
sect_num = cur_addr >> MG_SECTOR_SIZE_SHIFT;
- cnt = ((end_addr & MG_SECTOR_SIZE_MASK) - cur_addr) >>
+ cnt = ((end_addr & ~MG_SECTOR_SIZE_MASK) - cur_addr) >>
MG_SECTOR_SIZE_SHIFT;
if (cnt)
@@ -411,7 +411,6 @@ mg_read_exit:
return err;
}
-
static int mg_do_write_sects(void *buff, u32 sect_num, u32 sect_cnt)
{
u32 i, j, err;
@@ -523,7 +522,7 @@ unsigned int mg_disk_write(u32 addr, u8 *buff, u32 len)
if (cur_addr < end_addr) {
sect_num = cur_addr >> MG_SECTOR_SIZE_SHIFT;
- cnt = ((end_addr & MG_SECTOR_SIZE_MASK) - cur_addr) >>
+ cnt = ((end_addr & ~MG_SECTOR_SIZE_MASK) - cur_addr) >>
MG_SECTOR_SIZE_SHIFT;
if (cnt)
--
1.5.6.6
reply other threads:[~2009-02-18 10:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=499BE841.4080002@gmail.com \
--to=donari75@gmail.com \
--cc=u-boot@lists.denx.de \
/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.