[PATCH] checkpatch: MAINTAINERS: warn on missing paths

Eugene Mavick posted 1 patch 1 week, 6 days ago
scripts/checkpatch.pl | 9 +++++++++
1 file changed, 9 insertions(+)
[PATCH] checkpatch: MAINTAINERS: warn on missing paths
Posted by Eugene Mavick 1 week, 6 days ago
Warn when F: or X: entries point to nonexistent files or patterns.
There have been instances of typos in file entries in the past, and this
patch helps prevents that.

Signed-off-by: Eugene Mavick <m@mavick.dev>
---
 scripts/checkpatch.pl | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0492d6afc9a1..e82e330ea460 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3750,6 +3750,15 @@ sub process {
 					}
 				}
 			}
+# check MAINTAINERS file entry for file existence
+			if ($rawline =~ /^\+[FX]:\s*+(.*)/) {
+				my $entry = $1;
+				my @matches = glob($entry);
+				if (!@matches) {
+					WARN("MAINTAINERS_FILE_MISSING",
+					     "MAINTAINERS file entry references nonexistent file: '$entry'\n" . $herecurr);
+				}
+			}
 		}
 
 # check for DT compatible documentation

---
base-commit: 979c294509f9248fe1e7c358d582fb37dd5ca12d
change-id: 20260712-chkpatch-file-entries-90ae03915cde

Best regards,
-- 
Eugene Mavick <m@mavick.dev>
Re: [PATCH] checkpatch: MAINTAINERS: warn on missing paths
Posted by Joe Perches 1 week, 6 days ago
On Sun, 2026-07-12 at 16:14 +0800, Eugene Mavick wrote:
> ```
> Warn when F: or X: entries point to nonexistent files or patterns.
> There have been instances of typos in file entries in the past, and this
> patch helps prevents that.

Just fyi:

if you care to do something about the missing MAINTAINER file patterns

$ ./scripts/get_maintainer.pl --self-test=patterns
./MAINTAINERS:2764: warning: no file matches	F:	arch/arm/mach-ep93xx/ts72xx.c
./MAINTAINERS:7654: warning: no file matches	F:	include/linux/dma-buf/
./MAINTAINERS:7897: warning: no file matches	F:	include/linux/drbd*
./MAINTAINERS:10017: warning: no file matches	F:	include/linux/fs_types.h
./MAINTAINERS:12694: warning: no file matches	F:	drivers/gpu/drm/ci/xfails/powervr*
./MAINTAINERS:16731: warning: no file matches	F:	Documentation/devicetree/bindings/display/bridge/megachips-stdpxxxx-ge-b850v3-fw.txt
./MAINTAINERS:21913: warning: no file matches	F:	sound/arm/pxa*
./MAINTAINERS:22364: warning: no file matches	F:	include/dt-bindings/media/*qcom*
./MAINTAINERS:25130: warning: no file matches	F:	tools/testing/selftests/net/so_txtime.c
./MAINTAINERS:25342: warning: no file matches	F:	Documentation/devicetree/bindings/media/i2c/sony,imx678.yaml
./MAINTAINERS:28376: warning: no file matches	F:	include/linux/vsi-iommu.h
Re: [PATCH] checkpatch: MAINTAINERS: warn on missing paths
Posted by Eugene Mavick 1 week, 5 days ago
On Sun Jul 12, 2026 at 5:04 PM +08, Joe Perches wrote:
> On Sun, 2026-07-12 at 16:14 +0800, Eugene Mavick wrote:
>> ```
>> Warn when F: or X: entries point to nonexistent files or patterns.
>> There have been instances of typos in file entries in the past, and this
>> patch helps prevents that.
>
> Just fyi:
>
> if you care to do something about the missing MAINTAINER file patterns
>
> $ ./scripts/get_maintainer.pl --self-test=patterns
> ./MAINTAINERS:2764: warning: no file matches	F:	arch/arm/mach-ep93xx/ts72xx.c
> ./MAINTAINERS:7654: warning: no file matches	F:	include/linux/dma-buf/
> ./MAINTAINERS:7897: warning: no file matches	F:	include/linux/drbd*
> ./MAINTAINERS:10017: warning: no file matches	F:	include/linux/fs_types.h
> ./MAINTAINERS:12694: warning: no file matches	F:	drivers/gpu/drm/ci/xfails/powervr*
> ./MAINTAINERS:16731: warning: no file matches	F:	Documentation/devicetree/bindings/display/bridge/megachips-stdpxxxx-ge-b850v3-fw.txt
> ./MAINTAINERS:21913: warning: no file matches	F:	sound/arm/pxa*
> ./MAINTAINERS:22364: warning: no file matches	F:	include/dt-bindings/media/*qcom*
> ./MAINTAINERS:25130: warning: no file matches	F:	tools/testing/selftests/net/so_txtime.c
> ./MAINTAINERS:25342: warning: no file matches	F:	Documentation/devicetree/bindings/media/i2c/sony,imx678.yaml
> ./MAINTAINERS:28376: warning: no file matches	F:	include/linux/vsi-iommu.h

Thanks, here's the patch:
https://lore.kernel.org/all/20260713-fix-maintainers-entries-v1-1-800c6ad14201@mavick.dev/
Re: [PATCH] checkpatch: MAINTAINERS: warn on missing paths
Posted by Joe Perches 1 week, 6 days ago
On 2026-07-12 10:14, Eugene Mavick wrote:
> Warn when F: or X: entries point to nonexistent files or patterns.
> There have been instances of typos in file entries in the past, and 
> this
> patch helps prevents that.

Nack.

There's already a self test for that.