CONFIG_IS_ENABLED vs IS_ENABLED

Tom Rini trini at konsulko.com
Thu Jan 26 18:34:43 CET 2023


On Thu, Jan 26, 2023 at 09:26:18AM -0800, Troy Kisky wrote:
> 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.

Submitting a PR against https://github.com/u-boot/u-boot/ will trigger
an Azure CI run, and so a global build. And adding a test to CI to fail
on new introductions of this would be how to prevent further issues.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230126/ffbd5b46/attachment.sig>


More information about the U-Boot mailing list