[PATCH] drivers: watchdog: wdt-uclass: Use IS_ENABLED for WATCHDOG_AUTOSTART

Rasmus Villemoes rasmus.villemoes at prevas.dk
Fri Jun 18 14:52:17 CEST 2021


On 18/06/2021 13.14, Teresa Remmet wrote:
> There is no separate SPL/TPL config for WATCHDOG_AUTOSTART.
> So use IS_ENABLED instead of CONFIG_IS_ENABLED to make watchdog
> working in spl again.

I suppose it doesn't make sense to introduce SPL/TPL variants of that
(if one wants to handle a watchdog early, it should be handled early),
so ack.

But this whole thing seems extremely fragile. There really should be
some kind of sanity check, maybe just scripted run over the tree once in
while, that finds such issues. A very naive approach like

git grep -E -o 'CONFIG_IS_ENABLED\(\s*[A-Z0-9a-z_]*' | cut -f2 -d'(' |
sort -u | while read x ; do if ! git grep -q "config SPL_$x" && ! git
grep -q "config TPL_$x" ; then echo "No SPL or TPL variant of CONFIG_$x"
; fi ; done

finds a lot of stuff, but most are probably in files that cannot be
built for SPL/TPL (e.g. all the CMD_ stuff), so false positives. But
there's also somewhat amusing examples like

#if CONFIG_IS_ENABLED(FIT_PRINT) || CONFIG_IS_ENABLED(SPL_FIT_PRINT)

(which we find because there's no SPL_SPL_FIT_PRINT...).

Rasmus


More information about the U-Boot mailing list