MAINTAINERS: Cleanup non existing files
cover MAINTAINERS: Cleanup non existing files
Hi,
I found in my Microblaze fragment that cmd_mfsl.c doesn't exist but still it is recorded. That's why I wanted to check all entries and found that there are also other files which doesn't exist.
Tom: maybe good to run it in a CI to make sure that we don't get out of sync.
Thanks,
Michal
Michal Simek (2):
scripts: Add MAINTAINERS F: file existence checker
MAINTAINERS: Remove references to not existing files
MAINTAINERS | 45 ---------------------------- scripts/check_maintainers_files.sh | 47 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 45 deletions(-) create mode 100755 scripts/check_maintainers_files.sh
---
base-commit: 0b581a9612e46310ee52bf8359165950d38b2a2b
Signature · 1 line
2.43.0
PATCH 1/2 scripts: Add MAINTAINERS F: file existence checker
Add a small script that extracts all F: entries from the MAINTAINERS file and verifies that each one matches an existing file or directory. Entries are expanded as globs to match MAINTAINERS wildcard usage. The script errors out and exits non-zero when a reference points to a non-existing path, making it easy to catch stale entries.
---
scripts/check_maintainers_files.sh | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 scripts/check_maintainers_files.sh
scripts/check_maintainers_files.sh new file +47 -0
@@ -0,0 +1,47 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# Check that every "F:" file reference in MAINTAINERS exists. +# +# Each F: entry is treated as a shell glob (relative to the repo root), +# matching the way MAINTAINERS wildcards work. If a pattern matches no +# existing file or directory, it is reported and the script exits non-zero. + +set -u + +MAINTAINERS="${1:-MAINTAINERS}" + +if [ ! -f "$MAINTAINERS" ]; then + echo "error: cannot find $MAINTAINERS" >&2 + exit 2 +fi + +rc=0 + +while IFS= read -r pattern; do + # Strip the "F:" prefix and surrounding whitespace. + pattern=$(printf '%s\n' "$pattern" | sed -e 's/^F:[[:space:]]*//' -e 's/[[:space:]]*$//') + [ -n "$pattern" ] || continue + + # Expand the pattern as a glob; if nothing matches the glob stays literal. + matched=0 + for path in $pattern; do + if [ -e "$path" ]; then + matched=1 + break + fi + done + + if [ "$matched" -eq 0 ]; then + echo "error: MAINTAINERS references non-existing file: $pattern" >&2 + rc=1 + fi +done <<EOF +$(grep '^F:' "$MAINTAINERS") +EOF + +if [ "$rc" -eq 0 ]; then + echo "All MAINTAINERS F: entries exist." +fi + +exit $rc
Signature · 1 line
2.43.0
PATCH 2/2 MAINTAINERS: Remove references to not existing files
In reply to Michal SimekA number of file (F:) entries in MAINTAINERS pointed to files or directories which had been removed or renamed over time. Remove all of these stale references so every F: entry resolves to an existing path.
---
MAINTAINERS | 45 --------------------------------------------- 1 file changed, 45 deletions(-)
MAINTAINERS +0 -45
@@ -127,7 +127,6 @@ ARC HSDK RESET M: Eugeniy Paltsev <[email protected]> S: Maintained L: [email protected] -F: include/dt-bindings/reset/snps,hsdk-reset.h F: drivers/reset/reset-hsdk.c ARC SYNOPSYS DW MMC EXTENSIONS
@@ -156,7 +155,6 @@ F: drivers/pinctrl/pinctrl-apple.c F: drivers/power/domain/apple-pmgr.c F: drivers/spi/apple_spi.c F: drivers/watchdog/apple_wdt.c -F: include/configs/apple.h ARM M: Tom Rini <[email protected]>
@@ -248,7 +246,6 @@ F: drivers/serial/serial_bcm283x_mu.c F: drivers/serial/serial_bcm283x_pl011.c F: drivers/video/bcm2835.c F: include/dm/platform_data/serial_bcm283x_mu.h -F: include/dt-bindings/pinctrl/bcm2835.h F: drivers/pinctrl/broadcom/ F: configs/rpi_* T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-arm.git
@@ -284,7 +281,6 @@ S: Maintained F: arch/arm/mach-bcmstb/ F: board/broadcom/bcmstb/ F: configs/bcm7*_defconfig -F: doc/README.bcm7xxx F: drivers/mmc/bcmstb_sdhci.c F: drivers/spi/bcmstb_spi.c
@@ -349,9 +345,7 @@ ARM IPQ40XX M: Robert Marko <[email protected]> S: Maintained F: arch/arm/mach-ipq40xx/ -F: include/dt-bindings/clock/qcom,gcc-ipq4019.h F: drivers/clk/qcom/clock-ipq4019.c -F: drivers/phy/phy-qcom-ipq4019-usb.c F: drivers/spi/spi-qup.c F: drivers/net/mdio-ipq4019.c F: drivers/rng/msm_rng.c
@@ -439,7 +433,6 @@ S: Maintained T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-at91.git F: arch/arm/dts/sam* F: drivers/misc/microchip_flexcom.c -F: include/dt-bindings/sound/microchip,pdmc.h F: drivers/timer/mchp-pit64b-timer.c N: at91 N: atmel
@@ -464,7 +457,6 @@ F: configs/s5p4418_nanopi2_defconfig F: doc/README.s5p4418 F: drivers/gpio/nx_gpio.c F: drivers/i2c/nx_i2c.c -F: drivers/mmc/nexell_dw_mmc_dm.c F: drivers/pinctrl/nexell/ F: drivers/serial/serial_s5p4418_pl011.c F: drivers/video/nexell/
@@ -620,11 +612,8 @@ L: [email protected] S: Maintained T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-snapdragon.git F: configs/qcm6490_defconfig -F: configs/qcs9100_defconfig -F: drivers/*/*/pm8???-* F: drivers/gpio/msm_gpio.c F: drivers/mmc/msm_sdhci.c -F: drivers/phy/msm8916-usbh-phy.c F: drivers/phy/qcom/ F: drivers/serial/serial_msm.c F: drivers/serial/serial_msm_geni.c
@@ -648,10 +637,6 @@ F: drivers/reset/sti-reset.c F: drivers/serial/serial_sti_asc.c F: drivers/sysreset/sysreset_sti.c F: drivers/timer/arm_global_timer.c -F: drivers/usb/host/dwc3-sti.c -F: include/dt-bindings/clock/stih407-clks.h -F: include/dt-bindings/clock/stih410-clks.h -F: include/dt-bindings/reset/stih407-resets.h ARM STM STM32MP M: Patrick Delaunay <[email protected]>
@@ -667,7 +652,6 @@ F: drivers/gpio/stm32_gpio.c F: drivers/hwspinlock/stm32_hwspinlock.c F: drivers/i2c/stm32f7_i2c.c F: drivers/mailbox/stm32-ipcc.c -F: drivers/memory/stm32-omm.c F: drivers/misc/stm32mp_fuse.c F: drivers/misc/stm32_rcc.c F: drivers/mmc/stm32_sdmmc2.c
@@ -690,10 +674,7 @@ F: drivers/spi/stm32_spi.c F: drivers/video/stm32/stm32_ltdc.c F: drivers/video/stm32/stm32_lvds.c F: drivers/watchdog/stm32mp_wdt.c -F: include/dt-bindings/clock/stm32fx-clock.h F: include/dt-bindings/clock/stm32mp* -F: include/dt-bindings/pinctrl/stm32-pinfunc.h -F: include/dt-bindings/reset/stm32mp* F: include/stm32_rcc.h F: tools/logos/st.bmp F: tools/stm32image.c
@@ -745,7 +726,6 @@ F: drivers/firmware/ti_sci.* F: drivers/gpio/omap_gpio.c F: drivers/memory/ti-aemif.c F: drivers/misc/k3_avs.c -F: drivers/mailbox/k3-sec-procy.c F: drivers/pci/pcie_cdns_ti.c F: drivers/pci/pcie_dw_ti.c F: drivers/phy/keystone-usb-phy.c
@@ -756,7 +736,6 @@ F: drivers/ram/k3* F: drivers/ram/k3*/ F: drivers/remoteproc/ipu_rproc.c F: drivers/remoteproc/k3_system_controller.c -F: drivers/remoteproc/pruc_rpoc.c F: drivers/remoteproc/ti* F: drivers/reset/reset-dra7.c F: drivers/reset/reset-ti-sci.c
@@ -901,19 +880,14 @@ S: Maintained F: boot/bootdev*.c F: boot/bootflow.c F: boot/bootmeth*.c -F: boot/bootstd.c F: cmd/bootdev.c F: cmd/bootflow.c F: doc/develop/bootstd/ -F: doc/usage/bootdev.rst -F: doc/usage/bootflow.rst -F: doc/usage/bootmeth.rst F: drivers/mmc/mmc_bootdev.c F: include/bootdev.h F: include/bootflow.h F: include/bootmeth.h F: include/bootstd.h -F: net/eth_bootdevice.c F: test/boot/ BOOTMETH_ANDROID
@@ -969,7 +943,6 @@ M: Simon Glass <[email protected]> M: Hou Zhiqiang <[email protected]> S: Maintained F: cmd/cpu.c -F: doc/usage/cpu.rst CYCLIC M: Stefan Roese <[email protected]>
@@ -1007,7 +980,6 @@ DRIVER MODEL M: Simon Glass <[email protected]> S: Maintained T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-dm.git -F: doc/driver-model/ F: drivers/core/ F: include/dm/ F: test/dm/
@@ -1039,7 +1011,6 @@ F: cmd/nvedit_efi.c F: doc/api/efi.rst F: doc/develop/uefi/* F: doc/mkeficapsule.1 -F: doc/usage/bootefi.rst F: drivers/rtc/emul_rtc.c F: include/capitalization.h F: include/charset.h
@@ -1054,7 +1025,6 @@ F: lib/efi*/ F: test/lib/efi_* F: test/py/tests/test_efi* F: test/py/tests/test_efi*/ -F: test/unicode_ut.c F: cmd/bootefi.c F: cmd/efidebug.c F: cmd/nvedit_efi.c
@@ -1140,7 +1110,6 @@ F: lib/libfdt/ F: include/fdt* F: include/linux/libfdt* F: cmd/fdt.c -F: common/fdt_support.c F: scripts/dtc-version.sh FREEBSD
@@ -1256,7 +1225,6 @@ MALI DISPLAY PROCESSORS M: Liviu Dudau <[email protected]> S: Supported T: git git://github.com/ARM-software/u-boot.git -F: drivers/video/mali_dp.c F: drivers/i2c/i2c-versatile.c MBEDTLS
@@ -1276,7 +1244,6 @@ M: Michal Simek <[email protected]> S: Maintained T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-microblaze.git F: arch/microblaze/ -F: cmd/mfsl.c F: drivers/gpio/xilinx_gpio.c F: drivers/net/xilinx_axi_emac.c F: drivers/net/xilinx_emaclite.c
@@ -1372,7 +1339,6 @@ MIPS Octeon M: Aaron Williams <[email protected]> S: Maintained F: arch/mips/mach-octeon/ -F: arch/mips/include/asm/arch-octeon/ F: arch/mips/dts/mrvl,cn73xx.dtsi MMC
@@ -1396,9 +1362,7 @@ M: Jerome Forissier <[email protected]> S: Maintained T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-net.git F: cmd/lwip/ -F: cmd/net-lwip.c F: configs/qemu_arm64_lwip_defconfig -F: drivers/net/sandbox-lwip.c F: include/net-lwip.h F: lib/lwip/Makefile F: lib/lwip/u-boot/
@@ -1579,7 +1543,6 @@ T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-riscv.git F: arch/riscv/ F: cmd/riscv/ F: doc/arch/riscv.rst -F: doc/usage/sbi.rst F: drivers/sysreset/sysreset_sbi.c F: drivers/timer/andes_plmt_timer.c F: drivers/timer/riscv_aclint_timer.c
@@ -1625,7 +1588,6 @@ M: Simon Glass <[email protected]> S: Maintained F: arch/sandbox/ F: configs/sandbox* -F: doc/arch/sandbox.rst F: drivers/*/*sandbox*.c F: include/dt-bindings/*/sandbox*.h F: include/os.h
@@ -1658,7 +1620,6 @@ SETEXPR M: Roland Gaudig <[email protected]> S: Maintained F: cmd/printf.c -F: doc/usage/setexpr.rst SH M: Marek Vasut <[email protected]>
@@ -1740,7 +1701,6 @@ S: Maintained F: cmd/sqfs.c F: common/spl/spl_squashfs.c F: fs/squashfs/ -F: include/sqfs.h F: test/py/tests/test_fs/test_squashfs/ STACKPROTECTOR
@@ -1914,7 +1874,6 @@ VBE M: Simon Glass <[email protected]> S: Maintained F: boot/vbe* -F: common/spl_reloc.c F: include/vbe.h VIDEO
@@ -1929,9 +1888,6 @@ M: Bin Meng <[email protected]> S: Maintained F: drivers/virtio/ F: cmd/virtio.c -F: include/config/virtio/ -F: include/config/virtio.h -F: include/config/cmd/virtio.h F: include/virtio*.h F: test/dm/virtio.c F: doc/develop/driver-model/virtio.rst
@@ -1978,7 +1934,6 @@ M: Roger Knecht <[email protected]> S: Maintained F: cmd/xxd.c F: doc/usage/cmd/xxd.rst -F: test/py/tests/test_xxd/ THE REST M: Tom Rini <[email protected]>
Signature · 1 line
2.43.0
Quoted 8 lines · Michal Simek
Hi,
I found in my Microblaze fragment that
cmd_mfsl.cdoesn't exist but still it is recorded. That's why I wanted to check all entries and found that there are also other files which doesn't exist.Tom: maybe good to run it in a CI to make sure that we don't get out of sync.
Sounds like a good idea. I see between your posting and today another bad entry has been added, I'll go take care of it.
Signature · 1 line
Tom
Quoted 8 lines · Tom Rini
Quoted 6 lines · Michal Simek
Hi,
I found in my Microblaze fragment that
cmd_mfsl.cdoesn't exist but still it is recorded. That's why I wanted to check all entries and found that there are also other files which doesn't exist.
Quoted 5 lines
Quoted 2 lines
Tom: maybe good to run it in a CI to make sure that we don't get out of sync.
Sounds like a good idea. I see between your posting and today another bad entry has been added, I'll go take care of it.
And, I'm going to take this series to start with, as it's a good place to start. But it doesn't check all MAINTAINER files, just the top-level one. Cleanly updating it for checking all files needs a small bit of thinking. I Kludged it in and, whew, there's 252 bad listings. If you update the script, I'll take care of the problems.
Signature · 1 line
Tom
Quoted 8 lines · Michal Simek
I found in my Microblaze fragment that
cmd_mfsl.cdoesn't exist but still it is recorded. That's why I wanted to check all entries and found that there are also other files which doesn't exist.Tom: maybe good to run it in a CI to make sure that we don't get out of sync.
[...]
Applied to u-boot/next, thanks!
[1/2] scripts: Add MAINTAINERS F: file existence checker
commit: ec5843cd784630496864d684965ff17c1edefd36
[2/2] MAINTAINERS: Remove references to not existing files
commit: 35d27192f8725a294dae5af568e8ae1d2860701cSignature · 1 line
Tom