提交 7dd05b38 编写于 作者: F Florian Vaussard 提交者: Linus Torvalds

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: NFlorian Vaussard <florian.vaussard@epfl.ch>
Cc: Joe Perches <joe@perches.com>
Acked-by: NRob Herring <robh@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 4fbf32a6
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册