Re: [U-Boot] [PATCH 1/5] tools: mkimage: add support for gpimage format

Dear Murali,
In message 3E54258959B69E4282D79E01AB1F32B70466CE4A@DFLE11.ent.ti.com you wrote:
- if (do_swap32) {
gph_size = gpimage_swap32(gph->size);
gph_load_addr = gpimage_swap32(gph->load_addr);
- } else {
gph_size = gph->size;
gph_load_addr = gph->load_addr;
- }
I think it should be possible top write this code in such a way that you can avoid both the if- else and passing the do_swap32 parameter. It is my impression that the whole endianess handling needs some refinemant.
Actually I cannot see a place where do_swap32=0 is used..
This is done to keep the omapimage usage of this variable.
Is this actually used? It appear the omapimage handling would set do_swap32=1 only when imagename == "byteswap" (see "tools/omapimage.c"). Is this a practical usecase anywhere?
Best regards,
Wolfgang Denk

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 01/21/2014 02:34 PM, Wolfgang Denk wrote:
Dear Murali,
In message 3E54258959B69E4282D79E01AB1F32B70466CE4A@DFLE11.ent.ti.com you wrote:
- if (do_swap32) { + gph_size = gpimage_swap32(gph->size); +
gph_load_addr = gpimage_swap32(gph->load_addr); + } else { + gph_size = gph->size; + gph_load_addr = gph->load_addr; + }
I think it should be possible top write this code in such a way that you can avoid both the if- else and passing the do_swap32 parameter. It is my impression that the whole endianess handling needs some refinemant.
Actually I cannot see a place where do_swap32=0 is used..
This is done to keep the omapimage usage of this variable.
Is this actually used? It appear the omapimage handling would set do_swap32=1 only when imagename == "byteswap" (see "tools/omapimage.c"). Is this a practical usecase anywhere?
In omapimage? Yes. On gpimage? I doubt it.
- -- Tom
participants (2)
-
Tom Rini
-
Wolfgang Denk