소스 검색

scripts/checkpatch.pl: add check for declaration of pci_device_id

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joe Perches 14 년 전
부모
커밋
93ed0e2d07
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      scripts/checkpatch.pl

+ 5 - 0
scripts/checkpatch.pl

@@ -1881,6 +1881,11 @@ sub process {
 				$herecurr);
 				$herecurr);
                }
                }
 
 
+# check for declarations of struct pci_device_id
+		if ($line =~ /\bstruct\s+pci_device_id\s+\w+\s*\[\s*\]\s*\=\s*\{/) {
+			WARN("Use DEFINE_PCI_DEVICE_TABLE for struct pci_device_id\n" . $herecurr);
+		}
+
 # check for new typedefs, only function parameters and sparse annotations
 # check for new typedefs, only function parameters and sparse annotations
 # make sense.
 # make sense.
 		if ($line =~ /\btypedef\s/ &&
 		if ($line =~ /\btypedef\s/ &&