[U-Boot] [PATCH 1/3] tools: mkimage: hdr_size used to facilitate customized support

Prafulla Wadaskar prafulla at marvell.com
Sun Jul 19 07:41:57 CEST 2009


 

> -----Original Message-----
> From: Wolfgang Denk [mailto:wd at denx.de] 
> Sent: Sunday, July 19, 2009 3:04 AM
> To: Prafulla Wadaskar
> Cc: u-boot at lists.denx.de; Manas Saksena; Ronen Shitrit; 
> Nicolas Pitre; Ashish Karkare; Prabhanjan Sarnaik; Lennert Buijtenhek
> Subject: Re: [U-Boot] [PATCH 1/3] tools: mkimage: hdr_size 
> used to facilitate customized support
> 
> Dear Prafulla Wadaskar,
> 
> In message 
> <1247967958-4446-1-git-send-email-prafulla at marvell.com> you wrote:
> > hdr_size variable is initialized
> > at the start of image creation algorithm instead of reading 
> it each time.
> > This facilitate to use the common code for other image type 
> > implementations for ex. kwbimage
> 
> Hm... I have no idea what you are trying to do, or why. You 
> are aware that image_get_header_size()  is  a  static  
> inline,  returning  just "sizeof (image_header_t)"?
Dear Wolfgang

This is what done in image_get_header_size().
I do not want to disturb current mkimage implementation.
whereas for mkbimage creation the image_header size will come form kwbimag.h and not generic one which is used further in image creation part.

In brief, header size will be decided by which kind of image you are creating.

This is a generic change required for kwbimage support.
I have kept this change in separate patch to get some better readability of generic changes for kwbimage support.

> 
> As far as the context of mkimage goes, you could as well 
> consider it a constant.
This will be decided runtime hence can not be considered as constant.
Well I can update the relevant line kwbimage patch to read sizeof() instead of api kwbimage_get_header_size()
 
> 
> > Signed-off-by: Prafulla Wadaskar <prafulla at marvell.com>
> > ---
> >  tools/mkimage.c |   18 ++++++++----------
> >  1 files changed, 8 insertions(+), 10 deletions(-)
> > 
> > diff --git a/tools/mkimage.c b/tools/mkimage.c index 
> 967fe9a..c5b593c 
> > 100644
> > --- a/tools/mkimage.c
> > +++ b/tools/mkimage.c
> > @@ -250,9 +250,10 @@ NXTARG:		;
> >  	 *
> >  	 * write dummy header, to be fixed later
> >  	 */
> > -	memset (hdr, 0, image_get_header_size ());
> > -
> > -	if (write(ifd, hdr, image_get_header_size ()) != 
> image_get_header_size ()) {
> > +	int hdr_size;
> 
> We don't allow variable declarations in the middle of the code.
Okay I will more this up

Thanks and regards..
Prafulla . .


More information about the U-Boot mailing list