[U-Boot-Users] [PATCH] cfi_flash: make the command u32 only

Wolfgang Denk wd at denx.de
Tue Jul 15 12:52:39 CEST 2008


In message <20080715095143.GF30428 at www.tglx.de> you wrote:
> 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.

Well, if you write "u32" in the commit message...

> -static void flash_make_cmd (flash_info_t * info, ulong cmd, void *cmdbuf)
> +static void flash_make_cmd (flash_info_t * info, uint 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(uint) - cword_offset - 1);
>  #endif
> -		cp[cp_offset] = (cword_offset >= sizeof(ulong)) ? 0x00 : val;
> +		cp[cp_offset] = (cword_offset >= sizeof(uint)) ? 0x00 : val;
...

...you should also use "u32" (and not uint) in the patch.

Please fix.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have yet to add the ESP-driver to the kernel to read  the  mind  of
the user...                                       - Linus Torvalds in
      <Pine.LNX.3.91.960426110644.24860I-100000 at linux.cs.Helsinki.FI>




More information about the U-Boot mailing list