Dear Masahiro, In message <cak7lnatu2gnn2d2fxdvhpaooeqoydsotrvcfw6ugtt8zqid...@mail.gmail.com> you wrote: > > Yes, it really helped me. > Thank you!
You are welcome. > I think itest.l works as expected on 32bit architecture, > but the problem is that sizeof(unsigned long) is 8 > on 64bit architecture. Oh, yes, you are right, of course. Well, U-Boot has been too long written for 32 bit only... > So, "case 4" in the following gets 8-byte data. > This is probably not what we expect... > > switch (w) { > case 1: > l = (long)(*(unsigned char *)buf); > break; > case 2: > l = (long)(*(unsigned short *)buf); > break; > case 4: > l = (long)(*(unsigned long *)buf); > break; > } You are right. We should replace char/short/long by something more descriptive like u8/u16/u32 - and for 64 bit systems, we should a branch for 64 bit entities, too. Do you think you can prepare such a patch? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Machines take me by surprise with great frequency. - Alan Turing _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot