From: Sebastian Siewior Date: Tue, 15 Jul 2008 13:35:23 +0200 Subject: [U-Boot-Users] [PATCH v2] cfi_flash: make the command u32 only In-Reply-To: <20080715105239.2EA5B24304@gemini.denx.de> References: <20080715095143.GF30428@www.tglx.de> <20080715105239.2EA5B24304@gemini.denx.de> Message-ID: <20080715113523.GA2568@www.tglx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This got change by commit 93c56f212c [cfi_flash: support of long cmd in U-boot.] Long is the wrong type because it will behave differently on 64bit machnines in a way that is probably not expected. u32 should be enough. Cc: Alexey Korolev Cc: Vasiliy Leonenko Signed-off-by: Sebastian Siewior --- drivers/mtd/cfi_flash.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index c0ea97b..4340b1b 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -301,7 +301,7 @@ static inline void flash_unmap(flash_info_t *info, flash_sect_t sect, /*----------------------------------------------------------------------- * make a proper sized command based on the port and chip widths */ -static void flash_make_cmd (flash_info_t * info, ulong cmd, void *cmdbuf) +static void flash_make_cmd(flash_info_t *info, u32 cmd, void *cmdbuf) { int i; int cword_offset; @@ -316,9 +316,9 @@ static void flash_make_cmd (flash_info_t * info, ulong cmd, void *cmdbuf) val = *((uchar*)&cmd + cword_offset); #else cp_offset = i - 1; - val = *((uchar*)&cmd + sizeof(ulong) - cword_offset - 1); + val = *((uchar*)&cmd + sizeof(u32) - cword_offset - 1); #endif - cp[cp_offset] = (cword_offset >= sizeof(ulong)) ? 0x00 : val; + cp[cp_offset] = (cword_offset >= sizeof(u32)) ? 0x00 : val; } } @@ -433,7 +433,7 @@ static ulong flash_read_long (flash_info_t * info, flash_sect_t sect, * Write a proper sized command to the correct address */ static void flash_write_cmd (flash_info_t * info, flash_sect_t sect, - uint offset, ulong cmd) + uint offset, u32 cmd) { void *addr; -- 1.5.5.2