Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7dd05b38 authored by Florian Vaussard's avatar Florian Vaussard Committed by Linus Torvalds
Browse files

checkpatch: check compatible strings in .c and .h too



Look for ".compatible = "foo" strings not only in .dts files, but
in .c and .h too.

Signed-off-by: default avatarFlorian Vaussard <florian.vaussard@epfl.ch>
Cc: Joe Perches <joe@perches.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4fbf32a6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2074,8 +2074,10 @@ sub process {
		}

# check for DT compatible documentation
		if (defined $root && $realfile =~ /\.dts/ &&
		    $rawline =~ /^\+\s*compatible\s*=/) {
		if (defined $root &&
			(($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||
			 ($realfile =~ /\.[ch]$/ && $line =~ /^\+.*\.compatible\s*=\s*\"/))) {

			my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;

			foreach my $compat (@compats) {