Skip to contentSkip to conversation

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

PATCH New Joe Perches 1 participant 1 message Oct 22, 2010 Checkpatch

lore
Share & tools
lore

Joe Perches

author maintainer
#0 lore raw

PATCH 1/1 scripts/checkpatch.pl: Add check for declaration of pci_device_id

---
 scripts/checkpatch.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
scripts/checkpatch.pl +5 -0
index 2039acd..9929cec 100755
@@ -1806,6 +1806,11 @@ sub process {
 				$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
 # make sense.
 		if ($line =~ /\btypedef\s/ &&