On Fri, Jul 21, 2023 at 05:32:20PM +0200, Heinrich Schuchardt wrote:

> Commit 7d84fbb57312 ("spl: Provide more information on boot failure") left
> debug code to let boot_from_devices() always fail if CONFIG_SHOW_ERRORS=y.
> 
> Remove the debug code.
> 
> Fixes: 7d84fbb57312 ("spl: Provide more information on boot failure")
> Signed-off-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
> ---
>  common/spl/spl.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index d74acec10b..6305b96b69 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -692,8 +692,6 @@ static int boot_from_devices(struct spl_image_info 
> *spl_image,
>               struct spl_image_loader *loader;
>               int bootdev = spl_boot_list[i];
>  
> -             if (CONFIG_IS_ENABLED(SHOW_ERRORS))
> -                     ret = -ENXIO;
>               for (loader = drv; loader != drv + n_ents; loader++) {
>                       if (bootdev != loader->boot_device)
>                               continue;

That's not debug code, per the comment above it:
 * Return: 0 if OK, -ENODEV if there were no boot devices
 *      if CONFIG_SHOW_ERRORS is enabled, returns -ENXIO if there were
 *      devices but none worked

It's what it's supposed to do.  Is there some case you're hitting where
we aren't returning out of the function as you expected?

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to