Skip to contentSkip to conversation

CONFIG_IS_ENABLED vs IS_ENABLED

PATCH Superseded Troy Kisky 1 participant 4 messages Jun 19, 2023 – Sep 27, 2023

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Troy Kisky

author
#0 lore raw

v4 cover CONFIG_IS_ENABLED vs IS_ENABLED

This patch set gets ready to checks the usage of
CONFIG_IS_ENABLED/IS_ENABLED.

After the set has been applied, you can delete
test/usage_of_is_enabled_todo.txt
and run test/usage_of_is_enabled_commit.sh

The script test/usage_of_is_enabled_check.sh
checks for new questionable uses of
CONFIG_IS_ENABLED/IS_ENABLED and is added
to .azure-pipelines.yml, and
.gitlab-ci.yml

version 4 changes:
Down to just one patch, other issue fixed by other means Added the following new configs to todo
ACPI
DM_CLK
FEC_MXC
FWU_MULTI_BANK_UPDATE
IMX8M_VDD_SOC_850MV
MCFTMR
PANEL
SANDBOX64
SPLASH_SCREEN
SPLASH_SOURCE
SPL_LOAD_FIT
USB_ETH_RNDIS
VIDEO
VIDEO_BPP16
VIDEO_BPP32
VIDEO_BPP8
VIDEO_LOGO
X86_32BIT_INIT

version 3 changes:
Dropped changes to puma-rk3399 and ringneck-px30 in favor of Quentin Schulz's patch
https://patchwork.ozlabs.org/project/uboot/patch/20230301-tsd-env-nowhere-kconfig-v1-1-d5c08e096906@theobroma-systems.com/
https://patchwork.ozlabs.org/project/uboot/patch/20230301-tsd-env-nowhere-kconfig-v1-2-d5c08e096906@theobroma-systems.com/
Please apply them before this series.

Drop gateworks: venice: Always define setup_fec and setup_eqos Drop arm: cpu: armv7: ls102xa: fdt: remove eth_device support Simon's patches took care of these

Add to todo list, these new questionable uses that snuck into the code. PARTITION_TYPE_GUID
PHY_ATHEROS
RTC_SANDBOX

(no changes since v1)

Troy Kisky (1):
CI: add test/usage_of_is_enabled_check.sh

 .azure-pipelines.yml                |  11 ++
 .gitlab-ci.yml                      |   5 +
 test/usage_of_is_enabled_check.sh   |  19 +++
 test/usage_of_is_enabled_commit.sh  |  12 ++
 test/usage_of_is_enabled_correct.sh |  50 +++++++
 test/usage_of_is_enabled_exempt.txt |   9 ++
 test/usage_of_is_enabled_list.sh    |  86 +++++++++++
 test/usage_of_is_enabled_splcfg.txt |  21 +++
 test/usage_of_is_enabled_todo.txt   | 213 ++++++++++++++++++++++++++++
 9 files changed, 426 insertions(+)
 create mode 100755 test/usage_of_is_enabled_check.sh
 create mode 100755 test/usage_of_is_enabled_commit.sh
 create mode 100755 test/usage_of_is_enabled_correct.sh
 create mode 100644 test/usage_of_is_enabled_exempt.txt
 create mode 100755 test/usage_of_is_enabled_list.sh
 create mode 100644 test/usage_of_is_enabled_splcfg.txt
 create mode 100644 test/usage_of_is_enabled_todo.txt
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v4 1/1 CI: add test/usage_of_is_enabled_check.sh

Add script usage_of_is_enabled_check to print any configs that use CONFIG_IS_ENABLED instead of IS_ENABLED and vice versa.

Add usage_of_is_enabled_commit.sh to generate commits to fix the above issues.

You can remove entries from test/usage_of_is_enabled_todo.txt or the entire file and then run test/usage_of_is_enabled_commit.sh
to convert to suggested usage of CONFIG_IS_ENABLED/IS_ENABLED

or run test/usage_of_is_enabled_check.sh to
see which configs are still todo.

---

(no changes since v1)

 .azure-pipelines.yml                |  11 ++
 .gitlab-ci.yml                      |   5 +
 test/usage_of_is_enabled_check.sh   |  19 +++
 test/usage_of_is_enabled_commit.sh  |  12 ++
 test/usage_of_is_enabled_correct.sh |  50 +++++++
 test/usage_of_is_enabled_exempt.txt |   9 ++
 test/usage_of_is_enabled_list.sh    |  86 +++++++++++
 test/usage_of_is_enabled_splcfg.txt |  21 +++
 test/usage_of_is_enabled_todo.txt   | 213 ++++++++++++++++++++++++++++
 9 files changed, 426 insertions(+)
 create mode 100755 test/usage_of_is_enabled_check.sh
 create mode 100755 test/usage_of_is_enabled_commit.sh
 create mode 100755 test/usage_of_is_enabled_correct.sh
 create mode 100644 test/usage_of_is_enabled_exempt.txt
 create mode 100755 test/usage_of_is_enabled_list.sh
 create mode 100644 test/usage_of_is_enabled_splcfg.txt
 create mode 100644 test/usage_of_is_enabled_todo.txt
.azure-pipelines.yml +11 -0
index 3c1846a5bc3..9b5a0ab6459 100644
@@ -67,6 +67,17 @@ stages:
                   :^doc/ :^arch/arm/dts/ :^scripts/kconfig/lkc.h
                   :^include/linux/kconfig.h :^tools/ && exit 1 || exit 0
 
+  - job: check_usage_of_is_enabled
+    displayName: 'Check usage of CONFIG_IS_ENABLED vs IS_ENABLED'
+    pool:
+      vmImage: $(ubuntu_vm)
+    container:
+      image: $(ci_runner_image)
+      options: $(container_option)
+    steps:
+      # generate list of SPL configs
+      - script: test/usage_of_is_enabled_check.sh
+
   - job: cppcheck
     displayName: 'Static code analysis with cppcheck'
     pool:
.gitlab-ci.yml +5 -0
index e6c6ab3586e..2591feabfe6 100644
@@ -148,6 +148,11 @@ check for new CONFIG symbols outside Kconfig:
         :^doc/ :^arch/arm/dts/ :^scripts/kconfig/lkc.h
         :^include/linux/kconfig.h :^tools/ && exit 1 || exit 0
 
+check usage of CONFIG_IS_ENABLED vs IS_ENABLED:
+  stage: testsuites
+  script:
+    - ./test/usage_of_is_enabled_check.sh
+
 # QA jobs for code analytics
 # static code analysis with cppcheck (we can add --enable=all later)
 cppcheck:
test/usage_of_is_enabled_check.sh new file +19 -0
new file mode 100755
index 00000000000..6bd5d9c1ac7
@@ -0,0 +1,19 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Written by Troy Kisky <[email protected]>
+
+scriptdir=`dirname "$0"`;
+${scriptdir}/usage_of_is_enabled_list.sh | grep -vw FOO;
+if [ $? -eq 0 ] ; then
+	echo "The above may have incorrect usage of IS_ENABLED/"\
+"CONFIG_IS_ENABLED"
+	echo "Run test/usage_of_is_enabled_commit.sh and "\
+"squash with appropriate commit"
+	ret=1;
+else
+	ret=0;
+fi
+
+rm ${scriptdir}/splcfg.tmp ${scriptdir}/exclude.tmp
+exit ${ret}
test/usage_of_is_enabled_commit.sh new file +12 -0
new file mode 100755
index 00000000000..593dbd1428c
@@ -0,0 +1,12 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Written by Troy Kisky <[email protected]>
+
+scriptdir=`dirname "$0"`;
+${scriptdir}/usage_of_is_enabled_list.sh | \
+xargs -I {} sh -c "${scriptdir}/usage_of_is_enabled_correct.sh {}; \
+git commit -a -m\"CONFIG_{}: correct usage of CONFIG_IS_ENABLED/IS_ENABLED\";"
+
+
+rm ${scriptdir}/splcfg.tmp ${scriptdir}/exclude.tmp
test/usage_of_is_enabled_correct.sh new file +50 -0

50 lines not on this page · raw message

test/usage_of_is_enabled_exempt.txt new file +9 -0
new file mode 100644
index 00000000000..d9fefd6cb6c
@@ -0,0 +1,9 @@
+BLOBLIST
+BLOBLIST_FIXED
+DM_PMIC_PFUZE100
+FOO
+NAND_BOOT
+OF_CONTROL
+SYS_L2_PL310
+WATCHDOG
+X86_64
test/usage_of_is_enabled_list.sh new file +86 -0

86 lines not on this page · raw message

test/usage_of_is_enabled_splcfg.txt new file +21 -0
new file mode 100644
index 00000000000..29d6257c5c7
@@ -0,0 +1,21 @@
+BZIP2
+CONFIG_CLK
+CONSOLE_MUX
+DM_EVENT
+DM_HWSPINLOCK
+DM_RNG
+DM_STDIO
+EFI_DEVICE_PATH_TO_TEXT
+EFI_LOADER
+ERRNO_STR
+EVENT_DYNAMIC
+GENERATE_SMBIOS_TABLE
+IOMMU
+MMC_HW_PARTITIONING
+NAND_CS_INIT
+OFNODE_MULTI_TREE
+PINCTRL_ARMADA_38X
+PRE_CONSOLE_BUFFER
+RESET_MEDIATEK
+RESET_ROCKCHIP
+UT_DM
test/usage_of_is_enabled_todo.txt new file +213 -0

213 lines not on this page · raw message

Signature · 1 line
2.34.1
author
#2 lore raw

Re: [PATCH v4 1/1] CI: add test/usage_of_is_enabled_check.sh

Quoted 29 lines · Troy Kisky

Add script usage_of_is_enabled_check to print any configs that use CONFIG_IS_ENABLED instead of IS_ENABLED and vice versa.

Add usage_of_is_enabled_commit.sh to generate commits to fix the above issues.

You can remove entries from test/usage_of_is_enabled_todo.txt or the entire file and then run test/usage_of_is_enabled_commit.sh
to convert to suggested usage of CONFIG_IS_ENABLED/IS_ENABLED

or run test/usage_of_is_enabled_check.sh to
see which configs are still todo.

---

(no changes since v1)

 .azure-pipelines.yml                |  11 ++
 .gitlab-ci.yml                      |   5 +
 test/usage_of_is_enabled_check.sh   |  19 +++
 test/usage_of_is_enabled_commit.sh  |  12 ++
 test/usage_of_is_enabled_correct.sh |  50 +++++++
 test/usage_of_is_enabled_exempt.txt |   9 ++
 test/usage_of_is_enabled_list.sh    |  86 +++++++++++
 test/usage_of_is_enabled_splcfg.txt |  21 +++
 test/usage_of_is_enabled_todo.txt   | 213 ++++++++++++++++++++++++++++
Quoted 10 lines
 9 files changed, 426 insertions(+)
 create mode 100755 test/usage_of_is_enabled_check.sh
 create mode 100755 test/usage_of_is_enabled_commit.sh
 create mode 100755 test/usage_of_is_enabled_correct.sh
 create mode 100644 test/usage_of_is_enabled_exempt.txt
 create mode 100755 test/usage_of_is_enabled_list.sh
 create mode 100644 test/usage_of_is_enabled_splcfg.txt
 create mode 100644 test/usage_of_is_enabled_todo.txt

If this patch is still desirable, it can be updated by

rm test/usage_of_is_enabled_todo.txt test/usage_of_is_enabled_check.sh >test/usage_of_is_enabled_todo.txt

BR
Troy

author
#3 lore raw

Re: [PATCH v4 1/1] CI: add test/usage_of_is_enabled_check.sh

Quoted 44 lines · Troy Kisky
Quoted 29 lines · Troy Kisky

Add script usage_of_is_enabled_check to print any configs that use CONFIG_IS_ENABLED instead of IS_ENABLED and vice versa.

Add usage_of_is_enabled_commit.sh to generate commits to fix the above issues.

You can remove entries from test/usage_of_is_enabled_todo.txt or the entire file and then run test/usage_of_is_enabled_commit.sh
to convert to suggested usage of CONFIG_IS_ENABLED/IS_ENABLED

or run test/usage_of_is_enabled_check.sh to
see which configs are still todo.

---

(no changes since v1)

 .azure-pipelines.yml                |  11 ++
 .gitlab-ci.yml                      |   5 +
 test/usage_of_is_enabled_check.sh   |  19 +++
 test/usage_of_is_enabled_commit.sh  |  12 ++
 test/usage_of_is_enabled_correct.sh |  50 +++++++
 test/usage_of_is_enabled_exempt.txt |   9 ++
 test/usage_of_is_enabled_list.sh    |  86 +++++++++++
 test/usage_of_is_enabled_splcfg.txt |  21 +++
 test/usage_of_is_enabled_todo.txt   | 213 ++++++++++++++++++++++++++++
Quoted 10 lines
 9 files changed, 426 insertions(+)
 create mode 100755 test/usage_of_is_enabled_check.sh
 create mode 100755 test/usage_of_is_enabled_commit.sh
 create mode 100755 test/usage_of_is_enabled_correct.sh
 create mode 100644 test/usage_of_is_enabled_exempt.txt
 create mode 100755 test/usage_of_is_enabled_list.sh
 create mode 100644 test/usage_of_is_enabled_splcfg.txt
 create mode 100644 test/usage_of_is_enabled_todo.txt
Quoted 6 lines

If this patch is still desirable, it can be updated by

rm test/usage_of_is_enabled_todo.txt test/usage_of_is_enabled_check.sh >test/usage_of_is_enabled_todo.txt

And delete the last 2 lines

sed -i '$d' test/usage_of_is_enabled_todo.txt
sed -i '$d' test/usage_of_is_enabled_todo.txt

Quoted 4 lines

BR
Troy