public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH] image: Add support for ZSTD decompression
Date: Mon, 4 May 2020 09:03:58 -0400	[thread overview]
Message-ID: <20200504130358.GG12564@bill-the-cat> (raw)
In-Reply-To: <CA+HBbNGXgL26D2C1U0rsCEY2TA3pznSBM5PoN61N_LLBVE7asA@mail.gmail.com>

On Sun, May 03, 2020 at 12:24:14PM +0200, Robert Marko wrote:
> Hi,
> 
> I checked and SPL_ZSTD symbol already exists.
> But trying to use #if CONFIG_IS_ENABLED(ZSTD) inside
> of the switch case will fail with the preprocessor error:
> In file included from tools/common/image.c:1:

Ah right, oops.

> > ./tools/../common/image.c: In function ?image_decomp?:
> > ./tools/../common/image.c:510:22: error: missing binary operator before
> > token "("
> >   510 | #if CONFIG_IS_ENABLED(ZSTD)
> 
> 
> Outside of the switch_case it works fine

Sounds like <linux/kconfig.h> needs an explicit #include then.

> 
> 
> On Fri, May 1, 2020 at 6:42 PM Tom Rini <trini@konsulko.com> wrote:
> 
> > On Fri, May 01, 2020 at 05:15:41PM +0200, Robert Marko wrote:
> > > On Fri, May 1, 2020 at 4:56 PM Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Sat, Apr 25, 2020 at 07:37:21PM +0200, Robert Marko wrote:
> > > >
> > > > > This patch adds support for ZSTD decompression of FIT images.
> > > > >
> > > > > Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> > > > > Cc: Luka Perkov <luka.perkov@sartura.hr>
> > > > > ---
> > > > >  common/image.c  | 52
> > +++++++++++++++++++++++++++++++++++++++++++++++++
> > > > >  include/image.h |  1 +
> > > > >  2 files changed, 53 insertions(+)
> > > > >
> > > > > diff --git a/common/image.c b/common/image.c
> > > > > index 94873cb6ed..70ba0f4328 100644
> > > > > --- a/common/image.c
> > > > > +++ b/common/image.c
> > > > > @@ -42,6 +42,7 @@
> > > > >  #include <lzma/LzmaTypes.h>
> > > > >  #include <lzma/LzmaDec.h>
> > > > >  #include <lzma/LzmaTools.h>
> > > > > +#include <linux/zstd.h>
> > > > >
> > > > >  #ifdef CONFIG_CMD_BDI
> > > > >  extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *
> > const argv[]);
> > > > > @@ -193,6 +194,7 @@ static const table_entry_t uimage_comp[] = {
> > > > >       {       IH_COMP_LZMA,   "lzma",         "lzma compressed",
> >   },
> > > > >       {       IH_COMP_LZO,    "lzo",          "lzo compressed",
> >  },
> > > > >       {       IH_COMP_LZ4,    "lz4",          "lz4 compressed",
> >  },
> > > > > +     {       IH_COMP_ZSTD,   "zstd",         "zstd compressed",
> >   },
> > > > >       {       -1,             "",             "",
> >  },
> > > > >  };
> > > > >
> > > > > @@ -480,6 +482,56 @@ int image_decomp(int comp, ulong load, ulong
> > image_start, int type,
> > > > >               break;
> > > > >       }
> > > > >  #endif /* CONFIG_LZ4 */
> > > > > +#ifdef CONFIG_ZSTD
> > > >
> > > > We need to add SPL_ZSTD as a symbol to lib/Kconfig and then use
> > > > CONFIG_IS_ENABLED() tests here to avoid growth in SPL.  Thanks!
> > > Hi,
> > > is that something that I need to do or?
> >
> > Yes.  You need to add the symbol, and then the code you're adding needs
> > to make use of '#if CONFIG_IS_ENABLED(ZSTD)' rather than '#ifdef
> > CONFIG_ZSTD'.  Sorry for not being clear enough.
> >
> > --
> > Tom
> >

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200504/e2eea154/attachment.sig>

  reply	other threads:[~2020-05-04 13:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25 17:37 [PATCH] image: Add support for ZSTD decompression Robert Marko
2020-05-01 14:56 ` Tom Rini
2020-05-01 15:15   ` Robert Marko
2020-05-01 16:42     ` Tom Rini
2020-05-03 10:24       ` Robert Marko
2020-05-04 13:03         ` Tom Rini [this message]
2020-05-05 21:19           ` Robert Marko
2020-05-20 11:38             ` Robert Marko
2020-05-20 12:35               ` Tom Rini
2020-06-08 19:01                 ` Robert Marko
2020-06-10  9:13                   ` Rasmus Villemoes
2020-06-11 20:10                     ` Tom Rini
2020-07-08  3:02 ` Tom Rini

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=20200504130358.GG12564@bill-the-cat \
    --to=trini@konsulko.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