Skip to content

Commit

Permalink
scripts/checkpatch.pl: add check for declaration of pci_device_id
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <[email protected]>
Cc: Andy Whitcroft <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed Oct 26, 2010
1 parent cb710ec commit 93ed0e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,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/ &&
Expand Down

0 comments on commit 93ed0e2

Please sign in to comment.