All of lore.kernel.org
 help / color / mirror / Atom feed
* CONFIG_IS_ENABLED vs IS_ENABLED
@ 2023-01-24 22:52 Troy Kisky
  2023-01-24 23:31 ` Troy Kisky
  0 siblings, 1 reply; 17+ messages in thread
From: Troy Kisky @ 2023-01-24 22:52 UTC (permalink / raw)
  To: u-boot@lists.denx.de, sbabic@denx.de, trini@konsulko.com,
	festevam@gmail.com
  Cc: sjg@chromium.org, marex@denx.de

Hi Guys

In a recent debugging session, I stumbled across this line
drivers/mmc/mmc.c:      if (CONFIG_IS_ENABLED(MMC_QUIRKS) && mmc->quirks & quirk)

which prevents retries in SPL code, and was causing booting from an SD card to fail.
So I wrote a little script to print uses of
CONFIG_IS_ENABLED(x) which might need to be
IS_ENABLED(CONFIG_x) like the above one.

Here it is if you want to try it out.

git grep CONFIG_IS_ENABLED|sed -n -e "s/\(CONFIG_IS_ENABLED([0-9a-zA-Z_]*)\)/\n\1\n/gp"| \
sed -n -r "s/CONFIG_IS_ENABLED\(([0-9a-zA-Z_]+)\)/\1/p" |sort -u|xargs -I {} \
sh -c "git grep -E 'config [ST]PL_{}' | grep -q -E -w '[ST]PL_{}' || git grep 'CONFIG_IS_ENABLED({})'"

It prints CONFIG_IS_ENABLED(x) uses where there is no SPL_x or TPL_x.

BR
Troy


THIS MESSAGE, ANY ATTACHMENT(S), AND THE INFORMATION CONTAINED HEREIN MAY BE PROPRIETARY TO LAIRD CONNECTIVITY, LLC., BOUNDARY DEVICES, LLC. AND/OR ANOTHER PARTY, AND MAY FURTHER BE INTENDED TO BE KEPT CONFIDENTIAL. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DELETE THE EMAIL AND ANY ATTACHMENTS, AND IMMEDIATELY NOTIFY THE SENDER BY RETURN EMAIL. THIS MESSAGE AND ITS CONTENTS ARE THE PROPERTY OF LAIRD CONNECTIVITY, LLC. AND BOUNDARY DEVICES, LLC. AND MAY NOT BE REPRODUCED OR USED WITHOUT THE EXPRESS WRITTEN CONSENT OF LAIRD CONNECTIVITY, LLC. AND BOUNDARY DEVICES, LLC.

^ permalink raw reply	[flat|nested] 17+ messages in thread
* re: CONFIG_IS_ENABLED vs IS_ENABLED
@ 2023-01-26 17:26 Troy Kisky
  2023-01-26 17:34 ` Tom Rini
  0 siblings, 1 reply; 17+ messages in thread
From: Troy Kisky @ 2023-01-26 17:26 UTC (permalink / raw)
  To: u-boot@lists.denx.de, sjg, trini, festevam, marex; +Cc: gary.bisson

Thanks Simon

I switched emails to get rid of the legalese.
Below are scripts to commit the changes sorted by
CONFIG_x variable. The only one I know causes a problem
is CONFIG_OF_LIVE because of

drivers/core/Makefile
obj-$(CONFIG_$(SPL_)OF_LIVE)

So, that config needs to keep using CONFIG_IS_ENABLED even
though SPL_OF_LIVE isn't in any Kconfig file.

Maybe something like
config SPL_OF_LIVE
       bool

can be added to a Kconfig to prevent the bad change.

git grep CONFIG_IS_ENABLED|sed -n -e
"s/\(CONFIG_IS_ENABLED([0-9a-zA-Z_]*)\)/\n\1\n/gp"| \
sed -n -r "s/CONFIG_IS_ENABLED\(([0-9a-zA-Z_]+)\)/\1/p" |sort -u|xargs -I
{} \
sh -c "git grep -E 'config [ST]PL_{}' | grep -q -E -w '[ST]PL_{}' || { git
grep -l 'CONFIG_IS_ENABLED({})' | \
xargs -IFile sh -c \"sed -i
\\\"s/CONFIG_IS_ENABLED({})/IS_ENABLED(CONFIG_{})/g\\\" File\" ; \
git commit -a -m\"CONFIG_{}: change CONFIG_IS_ENABLED to IS_ENABLED\"; }"

git grep -w IS_ENABLED|sed -n -e
"s/\(IS_ENABLED(CONFIG_[0-9a-zA-Z_]*)\)/\n\1\n/gp"| \
sed -n -r "s/IS_ENABLED\(CONFIG_([0-9a-zA-Z_]+)\)/\1/p" |sort -u|xargs -I
{} \
sh -c "git grep -E 'config [ST]PL_{}' | grep -q -E -w '[ST]PL_{}' &&  { git
grep -l 'IS_ENABLED(CONFIG_{})' | \
xargs -IFile sh -c \"sed -i
\\\"s/IS_ENABLED(CONFIG_{})/CONFIG_IS_ENABLED({})/g\\\" File\" ; \
git commit -a -m\"CONFIG_{}: change IS_ENABLED to CONFIG_IS_ENABLED\"; }"


I compile tested a few boards, but a thorough compile test would be good. I
hope the above helps someone get a few of the changes in mainline.

BR
Troy

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-01-31 14:22 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-24 22:52 CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
2023-01-24 23:31 ` Troy Kisky
2023-01-25  1:36   ` Simon Glass
2023-01-26 17:21     ` Tom Rini
2023-01-26 18:04       ` Simon Glass
2023-01-26 18:16         ` Tom Rini
2023-01-26 21:29           ` Simon Glass
2023-01-26 21:33             ` Tom Rini
2023-01-27 14:30               ` Simon Glass
  -- strict thread matches above, loose matches on Subject: below --
2023-01-26 17:26 Troy Kisky
2023-01-26 17:34 ` Tom Rini
2023-01-28 17:25   ` Troy Kisky
2023-01-30 17:18     ` Tom Rini
2023-01-30 18:51       ` Troy Kisky
2023-01-30 19:44         ` Tom Rini
2023-01-30 22:16           ` Troy Kisky
2023-01-31 14:16             ` Simon Glass

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.