All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	Teresa Remmet <t.remmet@phytec.de>,
	u-boot@lists.denx.de
Cc: "Pali Rohár" <pali@kernel.org>
Subject: Re: [PATCH] drivers: watchdog: wdt-uclass: Use IS_ENABLED for WATCHDOG_AUTOSTART
Date: Fri, 18 Jun 2021 16:38:04 +0200	[thread overview]
Message-ID: <2f33bbab-f5ee-1e7d-4b19-b34f42e38143@denx.de> (raw)
In-Reply-To: <5f40e907-1581-6d86-5b2d-726eeb6889b0@prevas.dk>

On 18.06.21 14:52, Rasmus Villemoes wrote:
> 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.

I whole-heartily agree. I'm pretty sure, that the U-Boot source tree is
cluttered with misuses of these constructs.

> 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...).

It would be great if someone (you?) could come up with such a script.

Thanks,
Stefan

  reply	other threads:[~2021-06-18 14:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 11:14 [PATCH] drivers: watchdog: wdt-uclass: Use IS_ENABLED for WATCHDOG_AUTOSTART Teresa Remmet
2021-06-18 12:52 ` Rasmus Villemoes
2021-06-18 14:38   ` Stefan Roese [this message]
2021-06-18 14:35 ` Stefan Roese
2021-07-14 22:42 ` Tim Harvey
2021-07-15  6:43   ` Teresa Remmet

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=2f33bbab-f5ee-1e7d-4b19-b34f42e38143@denx.de \
    --to=sr@denx.de \
    --cc=pali@kernel.org \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=t.remmet@phytec.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.