summaryrefslogtreecommitdiff
path: root/drivers/cfi_flash.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-08-12 23:55:10 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-08-12 23:55:10 +0200
commit55d150d95dbd4612f229e1f503c3a6aa8ed08a96 (patch)
treee8b755c6b0c5d56c8d8777236baab8b1deb67451 /drivers/cfi_flash.c
parent2191923072413972d8dbf3e1b2f8ce6762a85800 (diff)
parent90e4e7836596d8ae5cead41a776b2b95c84182c6 (diff)
downloadu-boot-imx-55d150d95dbd4612f229e1f503c3a6aa8ed08a96.zip
u-boot-imx-55d150d95dbd4612f229e1f503c3a6aa8ed08a96.tar.gz
u-boot-imx-55d150d95dbd4612f229e1f503c3a6aa8ed08a96.tar.bz2
Merge with /home/wd/git/u-boot/master
Diffstat (limited to 'drivers/cfi_flash.c')
-rw-r--r--drivers/cfi_flash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c
index d8489d46..3d0f204 100644
--- a/drivers/cfi_flash.c
+++ b/drivers/cfi_flash.c
@@ -557,7 +557,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
i = buffered_size > cnt ? cnt : buffered_size;
if ((rc = flash_write_cfibuffer (info, wp, src, i)) != ERR_OK)
return rc;
- i -= (i % info->portwidth);
+ i -= i & (info->portwidth - 1);
wp += i;
src += i;
cnt -= i;
@@ -805,7 +805,7 @@ static void flash_make_cmd (flash_info_t * info, uchar cmd, void *cmdbuf)
uchar *cp = (uchar *) cmdbuf;
for (i = 0; i < info->portwidth; i++)
- *cp++ = ((i + 1) % info->chipwidth) ? '\0' : cmd;
+ *cp++ = ((i + 1) & (info->chipwidth - 1)) ? '\0' : cmd;
#if defined(__LITTLE_ENDIAN)
switch (info->portwidth) {
case FLASH_CFI_8BIT: