On Thu, Sep 17, 2026 at 06:02:25PM +0400, Alexey Charkov wrote:

> spl_decompression_enabled() names the two algorithms SPL happened to
> support, so every algorithm added to image_decomp() requires editing the
> header. It also asks about CONFIG_SPL_* from a header included in every
> phase, so a VPL build with VPL_LZMA reads SPL_LZMA and answers about the
> wrong phase.
> 
> Add a hidden per-phase symbol selected by any of the compression
> algorithms and ask about that instead, which also matches how
> image_decomp() gates its own cases.
> 
> SPL_BZIP2 is out of scope: lib/bzip2 has no phase-aware build rule.
> 
> Signed-off-by: Alexey Charkov <[email protected]>
> ---
>  include/spl.h |  6 +++---
>  lib/Kconfig   | 30 ++++++++++++++++++++++++++++++
>  2 files changed, 33 insertions(+), 3 deletions(-)
> 
> diff --git a/include/spl.h b/include/spl.h
> index 8a9f799f192a..50b41a3a3908 100644
> --- a/include/spl.h
> +++ b/include/spl.h
> @@ -1204,13 +1204,13 @@ int spl_load_fit_image(struct spl_image_info 
> *spl_image,
>                      const struct legacy_img_hdr *header);
>  
>  /*
> - * spl_decompression_enabled() - check decompression support is enabled for 
> SPL build
> + * spl_decompression_enabled() - check decompression support is enabled for 
> this phase
>   *
> - * Returns  true  if decompression support is enabled, else False
> + * Returns  true  if any decompression algorithm is enabled, else False
>   */
>  static inline bool spl_decompression_enabled(void)
>  {
> -     return IS_ENABLED(CONFIG_SPL_GZIP) || IS_ENABLED(CONFIG_SPL_LZMA);
> +     return CONFIG_IS_ENABLED(DECOMPRESSION);
>  }
>  

Is this build time check really required, or shouldn't the callers fail
out appropriately already?

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to