From 7dd05b38e5b729f412b617baad5c3363519cf1d4 Mon Sep 17 00:00:00 2001 From: Florian Vaussard Date: Thu, 3 Apr 2014 14:49:26 -0700 Subject: 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: Florian Vaussard Cc: Joe Perches Acked-by: Rob Herring Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 75b587e..271d2f9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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) { -- cgit v1.1