public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] Add unlzo command
Date: Fri, 17 Aug 2012 19:26:23 -0400	[thread overview]
Message-ID: <201208171926.24089.vapier@gentoo.org> (raw)
In-Reply-To: <1345237184-20849-2-git-send-email-joe.hershberger@ni.com>

On Friday 17 August 2012 16:59:44 Joe Hershberger wrote:
> --- a/common/Makefile
> +++ b/common/Makefile
>
>  ifdef CONFIG_LZMA
>  COBJS-$(CONFIG_CMD_UNLZMA) += cmd_unlzma.o
>  endif
> +ifdef CONFIG_LZO
> +COBJS-$(CONFIG_CMD_UNLZO) += cmd_unlzo.o
> +endif

imo, these ifdefs shouldn't exist.  the commands shouldn't get silently 
ignored because someone omitted an option.  add an #ifdef check to the .c file 
and have it #error out if the necessary config options aren't defined.

> --- /dev/null
> +++ b/common/cmd_unlzo.c
>
> +int do_unlzo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

static

> +	ret = lzop_decompress((void *)src, src_len, (void *)dst, &dst_len);
> +	if (ret != LZO_E_OK) {
> +		printf("unlzo: uncompress or overwrite error %d\n", ret);
> +		return -1;

how about returning ret ?

> +	sprintf(buf, "%lX", (unsigned long) dst_len);
> +	setenv("filesize", buf);

setenv_ulong() ?

> +U_BOOT_CMD(
> +	unlzo,	5,	1,	do_unlzo,
> +	"unlzo a memory region",
> +	"srcaddr srcsize dstaddr [dstsize]"
> +);

isn't there a way you could "stream" this so you don't need the srcsize ?  or 
does the lzop API not support that ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120817/e71f188e/attachment.pgp>

  reply	other threads:[~2012-08-17 23:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 20:59 [U-Boot] [PATCH 1/2] Add unlzma command Joe Hershberger
2012-08-17 20:59 ` [U-Boot] [PATCH 2/2] Add unlzo command Joe Hershberger
2012-08-17 23:26   ` Mike Frysinger [this message]
2012-09-18 21:25     ` Joe Hershberger
2012-08-17 23:28 ` [U-Boot] [PATCH 1/2] Add unlzma command Mike Frysinger

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=201208171926.24089.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --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