From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Fri, 17 Aug 2012 19:26:23 -0400 Subject: [U-Boot] [PATCH 2/2] Add unlzo command In-Reply-To: <1345237184-20849-2-git-send-email-joe.hershberger@ni.com> References: <1345237184-20849-1-git-send-email-joe.hershberger@ni.com> <1345237184-20849-2-git-send-email-joe.hershberger@ni.com> Message-ID: <201208171926.24089.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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: