diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9c9810030377..9fb30b15c9dc 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2634,10 +2634,13 @@ sub process { | |||
2634 | $herecurr); | 2634 | $herecurr); |
2635 | } | 2635 | } |
2636 | 2636 | ||
2637 | # check for declarations of struct pci_device_id | 2637 | # check for uses of DEFINE_PCI_DEVICE_TABLE |
2638 | if ($line =~ /\bstruct\s+pci_device_id\s+\w+\s*\[\s*\]\s*\=\s*\{/) { | 2638 | if ($line =~ /\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/) { |
2639 | WARN("DEFINE_PCI_DEVICE_TABLE", | 2639 | if (WARN("DEFINE_PCI_DEVICE_TABLE", |
2640 | "Use DEFINE_PCI_DEVICE_TABLE for struct pci_device_id\n" . $herecurr); | 2640 | "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && |
2641 | $fix) { | ||
2642 | $fixed[$linenr - 1] =~ s/\b(?:static\s+|)DEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=\s*/static const struct pci_device_id $1\[\] = /; | ||
2643 | } | ||
2641 | } | 2644 | } |
2642 | 2645 | ||
2643 | # check for new typedefs, only function parameters and sparse annotations | 2646 | # check for new typedefs, only function parameters and sparse annotations |