diff options
author | <m8@hekate.semihalf.com> | 2005-08-16 17:34:22 +0200 |
---|---|---|
committer | <m8@hekate.semihalf.com> | 2005-08-16 17:34:22 +0200 |
commit | 22e05df45cc343eda3266312bde676737d9bc70c (patch) | |
tree | 6f2209c6675e79d000e359725872a3ba15262140 /drivers | |
parent | d4f5c72896b6b47cae276f49081a801491be6838 (diff) | |
parent | 98128f389cc318dbd1d597cf8d2d09902cddcb4b (diff) |
Merge with pollux.denx.org:/home/git/u-boot/.git
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cfi_flash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c index d8489d46c0..3d0f204501 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: |