From: Wolfgang Denk Date: Tue, 21 Jan 2014 20:34:26 +0100 Subject: [U-Boot] [PATCH 1/5] tools: mkimage: add support for gpimage format In-Reply-To: <3E54258959B69E4282D79E01AB1F32B70466CE4A@DFLE11.ent.ti.com> References: <1390255810-19486-1-git-send-email-m-karicheri2@ti.com> <1390255810-19486-2-git-send-email-m-karicheri2@ti.com> <20140120224649.5266D3803D0@gemini.denx.de> <3E54258959B69E4282D79E01AB1F32B70466CE4A@DFLE11.ent.ti.com> Message-ID: <20140121193426.D2D8138201D@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 -- 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 Q: Do you know what the death rate around here is? A: One per person.