public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [U-BOOT][PATCH 2/4] mflash : Fix uncorrect mask operation
@ 2009-02-18 10:51 unsik Kim
  0 siblings, 0 replies; only message in thread
From: unsik Kim @ 2009-02-18 10:51 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-18 10:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-18 10:51 [U-Boot] [U-BOOT][PATCH 2/4] mflash : Fix uncorrect mask operation unsik Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox