[PATCH 1/1] spl: boot always fail on CONFIG_SHOW_ERRORS=y

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.schuchardt@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;

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.schuchardt@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))
for (loader = drv; loader != drv + n_ents; loader++) { if (bootdev != loader->boot_device) continue;ret = -ENXIO;
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?

Hi Heinrich,
On Fri, 21 Jul 2023 at 09:32, Heinrich Schuchardt heinrich.schuchardt@canonical.com 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.schuchardt@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;
That isn't actually debug code. If you look at the function comment you will see what value this represents:
* 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
What problem are you seeing?
for (loader = drv; loader != drv + n_ents; loader++) { if (bootdev != loader->boot_device) continue;
-- 2.40.1
Regards, Simon
participants (3)
-
Heinrich Schuchardt
-
Simon Glass
-
Tom Rini