| Both sides previous revision Previous revision Next revision | Previous revision |
| u-boot_unused_configs [2019/04/13 11:11] – [Example] rpjday | u-boot_unused_configs [2019/04/13 11:29] (current) – [False positives] rpjday |
|---|
| |
| so I can clearly improve the script. | so I can clearly improve the script. |
| | |
| | Also, I forgot to take into account that one could "select" a Kconfig option, whereupon that Kconfig option could then select further options, without ever testing the option itself. Here's an example: |
| | |
| | <code> |
| | >>>>> TEGRA_COMMON |
| | arch/arm/mach-tegra/Kconfig:23:config TEGRA_COMMON |
| | arch/arm/mach-tegra/Kconfig:58: select TEGRA_COMMON |
| | arch/arm/mach-tegra/Kconfig:66: select TEGRA_COMMON |
| | </code> |
| | |
| | My script flags that because there is no occurrence of "CONFIG_TEGRA_COMMON" but, of course, in this case, there doesn't have to be. Another improvement to be made. |
| |
| ===== Example ===== | ===== Example ===== |
| |
| Here's a single example of running the script on the directory ''drivers/mmc'', which generates some of the very false positives I just warned about, but also displays actual unused configs. | Here's a single example of running the script on the directory ''drivers/mmc'', which generates some of the very false positives I just warned about, but also displays actual unused configs. |
| | |
| | <code> |
| | $ find_unused_configs.sh drivers/mmc |
| | </code> |
| |
| <code> | <code> |
| |
| As you can see, most of that represent false positives, but the last few lines do in fact show Kbuild options that are unreferenced anywhere in the code base. | As you can see, most of that represent false positives, but the last few lines do in fact show Kbuild options that are unreferenced anywhere in the code base. |
| | |
| | ===== Example: arch/arm ===== |
| | |
| | As a second example, I listed all apparently unused Kbuild options under ''arch/arm''. Note how, mixed in with each example is a tree-wide scan for that symbol. |
| | |
| | <code> |
| | >>>>> 98DX3236 |
| | arch/arm/dts/armada-xp-98dx3236.dtsi:17: model = "Marvell 98DX3236 SoC"; |
| | arch/arm/dts/armada-xp-98dx3236.dtsi:55: * 98DX3236 has 1 x1 PCIe unit Gen2.0 |
| | arch/arm/mach-mvebu/Kconfig:78:config 98DX3236 |
| | arch/arm/mach-mvebu/cpu.c:231: puts("98DX3236-"); |
| | >>>>> 98DX3336 |
| | arch/arm/dts/armada-xp-98dx3336.dtsi:14: model = "Marvell 98DX3336 SoC"; |
| | arch/arm/mach-mvebu/Kconfig:74:config 98DX3336 |
| | arch/arm/mach-mvebu/Kconfig:157: select 98DX3336 |
| | arch/arm/mach-mvebu/cpu.c:234: puts("98DX3336-"); |
| | >>>>> 98DX4251 |
| | arch/arm/dts/armada-xp-98dx4251.dtsi:14: model = "Marvell 98DX4251 SoC"; |
| | arch/arm/mach-mvebu/Kconfig:70:config 98DX4251 |
| | arch/arm/mach-mvebu/cpu.c:237: puts("98DX4251-"); |
| | >>>>> ARMADA_32BIT |
| | arch/arm/mach-mvebu/Kconfig:7:config ARMADA_32BIT |
| | arch/arm/mach-mvebu/Kconfig:25: select ARMADA_32BIT |
| | arch/arm/mach-mvebu/Kconfig:29: select ARMADA_32BIT |
| | arch/arm/mach-mvebu/Kconfig:34: select ARMADA_32BIT |
| | arch/arm/mach-mvebu/Kconfig:68: select ARMADA_32BIT |
| | >>>>> ARMADA_64BIT |
| | arch/arm/mach-mvebu/Kconfig:18:config ARMADA_64BIT |
| | >>>>> BCM2836 |
| | arch/arm/mach-bcm283x/Kconfig:6:config BCM2836 |
| | arch/arm/mach-bcm283x/Kconfig:7: bool "Broadcom BCM2836 SoC support" |
| | arch/arm/mach-bcm283x/Kconfig:41: support BCM2836/BCM2837-based Raspberry Pis such as the RPi 2 and |
| | arch/arm/mach-bcm283x/Kconfig:66: Support for all BCM2836-based Raspberry Pi variants, such as |
| | arch/arm/mach-bcm283x/Kconfig:84: select BCM2836 |
| | >>>>> BCM2837 |
| | arch/arm/mach-bcm283x/Kconfig:12:config BCM2837 |
| | arch/arm/mach-bcm283x/Kconfig:13: bool "Broadcom BCM2837 SoC support" |
| | arch/arm/mach-bcm283x/Kconfig:17: bool "Broadcom BCM2837 SoC 32-bit support" |
| | arch/arm/mach-bcm283x/Kconfig:19: select BCM2837 |
| | arch/arm/mach-bcm283x/Kconfig:24: bool "Broadcom BCM2837 SoC 64-bit support" |
| | arch/arm/mach-bcm283x/Kconfig:26: select BCM2837 |
| | arch/arm/mach-bcm283x/Kconfig:41: support BCM2836/BCM2837-based Raspberry Pis such as the RPi 2 and |
| | arch/arm/mach-bcm283x/Kconfig:69: This option also supports BCM2837-based variants such as the RPi 3 |
| | arch/arm/mach-bcm283x/Kconfig:89: Support for all BCM2837-based Raspberry Pi variants, such as |
| | arch/arm/mach-bcm283x/Kconfig:105: Support for all BCM2837-based Raspberry Pi variants, such as |
| | >>>>> BCM2837_32B |
| | arch/arm/mach-bcm283x/Kconfig:16:config BCM2837_32B |
| | arch/arm/mach-bcm283x/Kconfig:100: select BCM2837_32B |
| | >>>>> BCM2837_64B |
| | arch/arm/mach-bcm283x/Kconfig:23:config BCM2837_64B |
| | arch/arm/mach-bcm283x/Kconfig:128: select BCM2837_64B |
| | >>>>> CM1136 |
| | arch/arm/mach-integrator/Kconfig:40:config CM1136 |
| | include/armcoremodule.h:35: /* CM1136-EJ-S */ |
| | tools/buildman/board.py:85: options: board-specific options (e.g. integratorcp:CM1136) |
| | >>>>> CM720T |
| | arch/arm/mach-integrator/Kconfig:24:config CM720T |
| | board/armltd/integrator/README:71:ap720t_config ** CM720T |
| | >>>>> CM946ES |
| | arch/arm/mach-integrator/Kconfig:36:config CM946ES |
| | >>>>> DRA7_DSPEVE_OPP_NOM |
| | arch/arm/mach-omap2/omap5/Kconfig:94:config DRA7_DSPEVE_OPP_NOM |
| | >>>>> DRA7_GPU_OPP_NOM |
| | arch/arm/mach-omap2/omap5/Kconfig:142:config DRA7_GPU_OPP_NOM |
| | >>>>> DRA7_IVA_OPP_NOM |
| | arch/arm/mach-omap2/omap5/Kconfig:118:config DRA7_IVA_OPP_NOM |
| | >>>>> MESON64_COMMON |
| | arch/arm/mach-meson/Kconfig:3:config MESON64_COMMON |
| | arch/arm/mach-meson/Kconfig:16: select MESON64_COMMON |
| | arch/arm/mach-meson/Kconfig:42: select MESON64_COMMON |
| | >>>>> MULTI_DTB_FIT_UNCOMPRESS_SZ |
| | arch/arm/mach-rmobile/Kconfig.64:92:config MULTI_DTB_FIT_UNCOMPRESS_SZ |
| | dts/Kconfig:174:config MULTI_DTB_FIT_UNCOMPRESS_SZ |
| | lib/fdtdec.c:1185: size_t sz_out = CONFIG_VAL(MULTI_DTB_FIT_UNCOMPRESS_SZ); |
| | >>>>> MULTI_DTB_FIT_USER_DEF_ADDR |
| | arch/arm/mach-rmobile/Kconfig.64:96:config MULTI_DTB_FIT_USER_DEF_ADDR |
| | dts/Kconfig:183:config MULTI_DTB_FIT_USER_DEF_ADDR |
| | lib/fdtdec.c:1210: dst = (void *)CONFIG_VAL(MULTI_DTB_FIT_USER_DEF_ADDR); |
| | >>>>> MV78460 |
| | arch/arm/dts/armada-xp-mv78460.dtsi:9: * Contains definitions specific to the Armada XP MV78460 SoC that are not |
| | arch/arm/dts/armada-xp-mv78460.dtsi:16: model = "Marvell Armada XP MV78460 SoC"; |
| | arch/arm/dts/armada-xp-mv78460.dtsi:66: * MV78460 has 4 PCIe units Gen2.0: Two units can be |
| | arch/arm/mach-mvebu/Kconfig:62:config MV78460 |
| | arch/arm/mach-mvebu/Kconfig:131: select MV78460 |
| | arch/arm/mach-mvebu/Kconfig:139: select MV78460 |
| | arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c:153: * Right now only MV78460 is supported. Other SoC's might need |
| | arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c:163: * Right now only MV78460 is supported. Other SoC's might need |
| | arch/arm/mach-mvebu/cpu.c:216: puts("MV78460-"); |
| | >>>>> MX6_SMP |
| | arch/arm/mach-imx/mx6/Kconfig:3:config MX6_SMP |
| | arch/arm/mach-imx/mx6/Kconfig:21: select MX6_SMP |
| | arch/arm/mach-imx/mx6/Kconfig:26: select MX6_SMP |
| | arch/arm/mach-imx/mx6/Kconfig:31: select MX6_SMP |
| | arch/arm/mach-imx/mx6/Kconfig:36: select MX6_SMP |
| | >>>>> PUB_ROM_DATA_SIZE |
| | arch/arm/mach-omap2/am33xx/Kconfig:284:config PUB_ROM_DATA_SIZE |
| | >>>>> R8A7795 |
| | arch/arm/dts/r8a7795-u-boot.dtsi:3: * Device Tree Source extras for U-Boot on RCar R8A7795 SoC |
| | arch/arm/mach-rmobile/Kconfig.64:5:config R8A7795 |
| | arch/arm/mach-rmobile/Kconfig.64:6: bool "Renesas SoC R8A7795" |
| | arch/arm/mach-rmobile/Kconfig.64:61: imply R8A7795 |
| | arch/arm/mach-rmobile/Kconfig.64:72: imply R8A7795 |
| | arch/arm/mach-rmobile/cpu_info.c:62: { RMOBILE_CPU_TYPE_R8A7795, "R8A7795" }, |
| | doc/README.rmobile:29:| R8A7795 H3 | Renesas Electronics ULCB ES2.0+ | r8a7795_ulcb |
| | drivers/pinctrl/renesas/Kconfig:60: bool "Renesas RCar Gen3 R8A7795 pin control driver" |
| | drivers/pinctrl/renesas/Kconfig:63: Support pin multiplexing control on Renesas RCar Gen3 R8A7795 SoCs. |
| | drivers/pinctrl/renesas/pfc-r8a7795.c:3: * R8A7795 ES2.0+ processor support - PFC hardware block. |
| | drivers/pinctrl/renesas/pfc-r8a7795.c:1513: * R8A7795 has 8 banks with 32 GPIOs in each => 256 GPIOs. |
| | drivers/clk/renesas/Kconfig:52: bool "Renesas R8A7795 clock driver" |
| | drivers/clk/renesas/Kconfig:55: Enable this to support the clocks on Renesas R8A7795 SoC. |
| | >>>>> R8A7796 |
| | arch/arm/dts/r8a7796-u-boot.dtsi:3: * Device Tree Source extras for U-Boot on RCar R8A7796 SoC |
| | arch/arm/mach-rmobile/Kconfig.64:10:config R8A7796 |
| | arch/arm/mach-rmobile/Kconfig.64:11: bool "Renesas SoC R8A7796" |
| | arch/arm/mach-rmobile/Kconfig.64:62: imply R8A7796 |
| | arch/arm/mach-rmobile/Kconfig.64:73: imply R8A7796 |
| | arch/arm/mach-rmobile/cpu_info.c:63: { RMOBILE_CPU_TYPE_R8A7796, "R8A7796" }, |
| | doc/README.rmobile:32:| R8A7796 M3-W | Renesas Electronics ULCB | r8a7796_ulcb |
| | drivers/pinctrl/renesas/Kconfig:70: bool "Renesas RCar Gen3 R8A7796 pin control driver" |
| | drivers/pinctrl/renesas/Kconfig:73: Support pin multiplexing control on Renesas RCar Gen3 R8A7796 SoCs. |
| | drivers/pinctrl/renesas/pfc-r8a7796.c:3: * R8A7796 processor support - PFC hardware block. |
| | drivers/pinctrl/renesas/pfc-r8a7796.c:1523: * R8A7796 has 8 banks with 32 GPIOs in each => 256 GPIOs. |
| | drivers/pinctrl/renesas/pfc-r8a77990.c:9: * R8A7796 processor support - PFC hardware block. |
| | drivers/clk/renesas/r8a7796-cpg-mssr.c:3: * Renesas R8A7796 CPG MSSR driver |
| | drivers/clk/renesas/Kconfig:58: bool "Renesas R8A7796 clock driver" |
| | drivers/clk/renesas/Kconfig:61: Enable this to support the clocks on Renesas R8A7796 SoC. |
| | >>>>> R8A77965 |
| | arch/arm/dts/r8a77965.dtsi:3: * Device Tree Source for the R-Car M3-N (R8A77965) SoC |
| | arch/arm/dts/r8a77965-u-boot.dtsi:3: * Device Tree Source extras for U-Boot on RCar R8A77965 SoC |
| | arch/arm/mach-rmobile/Kconfig.64:15:config R8A77965 |
| | arch/arm/mach-rmobile/Kconfig.64:16: bool "Renesas SoC R8A77965" |
| | arch/arm/mach-rmobile/Kconfig.64:63: imply R8A77965 |
| | arch/arm/mach-rmobile/Kconfig.64:74: imply R8A77965 |
| | arch/arm/mach-rmobile/cpu_info.c:64: { RMOBILE_CPU_TYPE_R8A77965, "R8A77965" }, |
| | doc/README.rmobile:35:| R8A77965 M3-N | Renesas Electronics ULCB | r8a77965_ulcb |
| | drivers/pinctrl/renesas/Kconfig:80: bool "Renesas RCar Gen3 R8A77965 pin control driver" |
| | drivers/pinctrl/renesas/Kconfig:83: Support pin multiplexing control on Renesas RCar Gen3 R8A77965 SoCs. |
| | drivers/pinctrl/renesas/pfc-r8a77965.c:3: * R8A77965 processor support - PFC hardware block. |
| | drivers/pinctrl/renesas/pfc-r8a77965.c:1518: * R8A77965 has 8 banks with 32 GPIOs in each => 256 GPIOs. |
| | drivers/clk/renesas/Kconfig:64: bool "Renesas R8A77965 clock driver" |
| | drivers/clk/renesas/Kconfig:67: Enable this to support the clocks on Renesas R8A77965 SoC. |
| | >>>>> R8A77970 |
| | arch/arm/dts/r8a77970.dtsi:3: * Device Tree Source for the R-Car V3M (R8A77970) SoC |
| | arch/arm/dts/r8a77970-u-boot.dtsi:3: * Device Tree Source extras for U-Boot on RCar R8A77970 SoC |
| | arch/arm/mach-rmobile/Kconfig.64:20:config R8A77970 |
| | arch/arm/mach-rmobile/Kconfig.64:21: bool "Renesas SoC R8A77970" |
| | arch/arm/mach-rmobile/Kconfig.64:49: imply R8A77970 |
| | arch/arm/mach-rmobile/cpu_info.c:65: { RMOBILE_CPU_TYPE_R8A77970, "R8A77970" }, |
| | drivers/pinctrl/renesas/Kconfig:90: bool "Renesas RCar Gen3 R8A77970 pin control driver" |
| | drivers/pinctrl/renesas/Kconfig:93: Support pin multiplexing control on Renesas RCar Gen3 R8A77970 SoCs. |
| | drivers/pinctrl/renesas/pfc-r8a77970.c:3: * R8A77970 processor support - PFC hardware block. |
| | drivers/clk/renesas/Kconfig:70: bool "Renesas R8A77970 clock driver" |
| | drivers/clk/renesas/Kconfig:73: Enable this to support the clocks on Renesas R8A77970 SoC. |
| | drivers/clk/renesas/r8a77970-cpg-mssr.c:3: * Renesas R8A77970 CPG MSSR driver |
| | >>>>> R8A77990 |
| | arch/arm/dts/r8a77990-u-boot.dtsi:3: * Device Tree Source extras for U-Boot on RCar R8A77990 SoC |
| | arch/arm/dts/r8a77990.dtsi:3: * Device Tree Source for the R-Car E3 (R8A77990) SoC |
| | arch/arm/mach-rmobile/Kconfig.64:25:config R8A77990 |
| | arch/arm/mach-rmobile/Kconfig.64:26: bool "Renesas SoC R8A77990" |
| | arch/arm/mach-rmobile/Kconfig.64:55: imply R8A77990 |
| | arch/arm/mach-rmobile/cpu_info.c:66: { RMOBILE_CPU_TYPE_R8A77990, "R8A77990" }, |
| | drivers/pinctrl/renesas/Kconfig:100: bool "Renesas RCar Gen3 R8A77990 pin control driver" |
| | drivers/pinctrl/renesas/Kconfig:103: Support pin multiplexing control on Renesas RCar Gen3 R8A77990 SoCs. |
| | drivers/pinctrl/renesas/pfc-r8a77990.c:3: * R8A77990 processor support - PFC hardware block. |
| | drivers/pinctrl/renesas/pfc-r8a77990.c:1285: * R8A77990 has 7 banks with 32 GPIOs in each => 224 GPIOs. |
| | drivers/pinctrl/renesas/pfc-r8a77990.c:1299: * The pin positions are different between different R8A77990 |
| | drivers/pinctrl/renesas/pfc-r8a77990.c:1302: * R8A77990 to calculate a unique number for each pin. |
| | drivers/clk/renesas/Kconfig:76: bool "Renesas R8A77990 clock driver" |
| | drivers/clk/renesas/Kconfig:79: Enable this to support the clocks on Renesas R8A77990 SoC. |
| | >>>>> R8A77995 |
| | arch/arm/dts/r8a77995.dtsi:3: * Device Tree Source for the R-Car D3 (R8A77995) SoC |
| | arch/arm/dts/r8a77995-u-boot.dtsi:3: * Device Tree Source extras for U-Boot on RCar R8A77995 SoC |
| | arch/arm/mach-rmobile/Kconfig.64:30:config R8A77995 |
| | arch/arm/mach-rmobile/Kconfig.64:31: bool "Renesas SoC R8A77995" |
| | arch/arm/mach-rmobile/Kconfig.64:43: imply R8A77995 |
| | arch/arm/mach-rmobile/cpu_info.c:67: { RMOBILE_CPU_TYPE_R8A77995, "R8A77995" }, |
| | drivers/pinctrl/renesas/pfc-r8a77995.c:3: * R8A77995 processor support - PFC hardware block. |
| | drivers/pinctrl/renesas/Kconfig:110: bool "Renesas RCar Gen3 R8A77995 pin control driver" |
| | drivers/pinctrl/renesas/Kconfig:113: Support pin multiplexing control on Renesas RCar Gen3 R8A77995 SoCs. |
| | drivers/clk/renesas/Kconfig:82: bool "Renesas R8A77995 clock driver" |
| | drivers/clk/renesas/Kconfig:85: Enable this to support the clocks on Renesas R8A77995 SoC. |
| | >>>>> SPL_ROCKCHIP_EARLYRETURN_TO_BROM |
| | arch/arm/mach-rockchip/Kconfig:36: select SPL_ROCKCHIP_EARLYRETURN_TO_BROM |
| | arch/arm/mach-rockchip/Kconfig:209:config SPL_ROCKCHIP_EARLYRETURN_TO_BROM |
| | >>>>> SPL_SYS_THUMB_BUILD |
| | arch/arm/Kconfig:331:config SPL_SYS_THUMB_BUILD |
| | arch/arm/Kconfig:868: select SPL_SYS_THUMB_BUILD if !ARM64 |
| | >>>>> SPL_ZYNQMP_TWO_SDHCI |
| | arch/arm/mach-zynqmp/Kconfig:102:config SPL_ZYNQMP_TWO_SDHCI |
| | arch/arm/mach-zynqmp/spl.c:88:#if defined(SPL_ZYNQMP_TWO_SDHCI) |
| | >>>>> SYS_FSL_ERRATUM_A008407 |
| | arch/arm/cpu/armv7/ls102xa/Kconfig:6: select SYS_FSL_ERRATUM_A008407 |
| | arch/arm/cpu/armv7/ls102xa/Kconfig:112:config SYS_FSL_ERRATUM_A008407 |
| | >>>>> SYS_K3_MCU_SCRATCHPAD_SIZE |
| | arch/arm/mach-k3/Kconfig:37:config SYS_K3_MCU_SCRATCHPAD_SIZE |
| | >>>>> TARGET_RPI |
| | arch/arm/mach-bcm283x/Kconfig:36:config TARGET_RPI |
| | >>>>> TARGET_RPI_0_W |
| | arch/arm/mach-bcm283x/Kconfig:47:config TARGET_RPI_0_W |
| | >>>>> TARGET_RPI_3 |
| | arch/arm/mach-bcm283x/Kconfig:102:config TARGET_RPI_3 |
| | >>>>> TARGET_VEXPRESS64_AEMV8A |
| | arch/arm/Kconfig:975:config TARGET_VEXPRESS64_AEMV8A |
| | >>>>> TEGRA_ARMV7_COMMON |
| | arch/arm/mach-tegra/Kconfig:52:config TEGRA_ARMV7_COMMON |
| | arch/arm/mach-tegra/Kconfig:82: select TEGRA_ARMV7_COMMON |
| | arch/arm/mach-tegra/Kconfig:88: select TEGRA_ARMV7_COMMON |
| | arch/arm/mach-tegra/Kconfig:92: select TEGRA_ARMV7_COMMON |
| | arch/arm/mach-tegra/Kconfig:96: select TEGRA_ARMV7_COMMON |
| | >>>>> TEGRA_COMMON |
| | arch/arm/mach-tegra/Kconfig:23:config TEGRA_COMMON |
| | arch/arm/mach-tegra/Kconfig:58: select TEGRA_COMMON |
| | arch/arm/mach-tegra/Kconfig:66: select TEGRA_COMMON |
| | >>>>> TPL_MAX_SIZE |
| | arch/arm/mach-rockchip/Kconfig:80:config TPL_MAX_SIZE |
| | arch/arm/mach-rockchip/Kconfig:122:config TPL_MAX_SIZE |
| | common/spl/Kconfig:986:config TPL_MAX_SIZE |
| | >>>>> TPL_ROCKCHIP_BACK_TO_BROM |
| | arch/arm/mach-rockchip/Kconfig:174:config TPL_ROCKCHIP_BACK_TO_BROM |
| | >>>>> TPL_ROCKCHIP_EARLYRETURN_TO_BROM |
| | arch/arm/mach-rockchip/Kconfig:223:config TPL_ROCKCHIP_EARLYRETURN_TO_BROM |
| | >>>>> VIDEO_LCD_PANEL_HITACHI_TX18D42VM |
| | arch/arm/mach-sunxi/Kconfig:946:config VIDEO_LCD_PANEL_HITACHI_TX18D42VM |
| | >>>>> VIDEO_LCD_PANEL_LVDS |
| | arch/arm/mach-sunxi/Kconfig:926:config VIDEO_LCD_PANEL_LVDS |
| | >>>>> VIDEO_LCD_PANEL_PARALLEL |
| | arch/arm/mach-sunxi/Kconfig:922:config VIDEO_LCD_PANEL_PARALLEL |
| | </code> |