public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Dunn <mikedunn@newsguy.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4] palmtreo680: add utility that writes u-boot to flash
Date: Thu, 18 Apr 2013 08:47:19 -0700	[thread overview]
Message-ID: <51701587.9060309@newsguy.com> (raw)
In-Reply-To: <201304181554.15041.marex@denx.de>

On 04/18/2013 06:54 AM, Marek Vasut wrote:
> Dear Mike Dunn,
> 
> [...]
> 
>> +	if (argc != 3) {
>> +		printf("usage: %s <image file> <mtd dev node>\n", argv[0]);
> 
> btw is this /dev/mtdX or /dev/mtdblockX ?


/dev/mtdx  You must have defined a partition that starts at the offset at which
you are placing the u-boot image, and of course is big enough to hold the image.


> 
>> +		return -1;
> 
> errno.h didn't work? Like ... return -EINVAL or such ?


'return -EINVAL' works, sure.  Are you suggesting that the utility should return
an intelligent error code at all failure exit points?  Like if the call to
calloc() fails, it should return -ENOMEM?  I could do that if you prefer.  I
didn't worry about it because I always print the reason for the failure to
stderr, usually by way of perror().  Sorry, I guess I didn't understand your
initial suggestion.


> 
> [...]
> 
>> +	blockbuf = calloc(RELIABLE_BLOCKSIZE, 1);
> 
> calloc() semantics are misunderstood by so many :-(


calloc(RELIABLE_BLOCKSIZE, sizeof(char)) ?


Thanks,
Mike

  reply	other threads:[~2013-04-18 15:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 20:15 [U-Boot] [PATCH v4] palmtreo680: add utility that writes u-boot to flash Mike Dunn
2013-04-18 13:54 ` Marek Vasut
2013-04-18 15:47   ` Mike Dunn [this message]
2013-04-18 16:13     ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51701587.9060309@newsguy.com \
    --to=mikedunn@newsguy.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox