[PATCH] uncompress: simplify prototype of uncompress()

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Thu Nov 16 00:01:35 PST 2023


On Thu, Nov 16, 2023 at 08:22:44AM +0100, Sascha Hauer wrote:
> On Mon, Nov 13, 2023 at 08:00:35PM +0100, Uwe Kleine-König wrote:
> > All callers apart from lib/uncompress.c itself only use memory-to-memory
> > decompression. Simplify the calls accordingly.
> > 
> > Note that two of three callers passed error_fn=NULL. As the uncompress
> > function calls error_fn() unconditionally on error, this might yield
> > undefined behaviour and so the new uncompress function uses
> > uncompress_err_stdout() as error function which isn't worse for sure.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> > ---
> >  arch/arm/cpu/start.c    |  2 +-
> >  arch/riscv/boot/start.c |  2 +-
> >  defaultenv/defaultenv.c |  4 +---
> >  include/uncompress.h    |  7 +------
> >  lib/uncompress.c        | 24 +++++++++++++++---------
> >  5 files changed, 19 insertions(+), 20 deletions(-)
> 
> I had to revert this one. You missed one call site of uncompress() in
> uimage_load(). That one can't be converted as it uses the fill argument
> to uncompress().

Yes indeed. Missed that because I grepped for "uncompress(", sorry!

That instance might be converted to uncompress_fd_to_buf, but that's not
completely trivial. I'll take a look.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20231116/80eb08c2/attachment.sig>


More information about the barebox mailing list