diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-12-20 14:51:52 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-12-20 14:51:52 -0500 |
commit | 79bf7fc51118e4ffc61a0a8c943b94c394aa3ecc (patch) | |
tree | 037cb2a89f1e74f5b751a58135a5600fc43a04b5 /scripts/checkpatch.pl | |
parent | 47e0ab3f39aec53d9b7ac77dbe11a645e40583f9 (diff) | |
parent | 92e112fdbb3cb55b43390426501a7efacd893b96 (diff) |
Merge branch 'pci/misc' into next
* pci/misc:
PCI/checkpatch: Deprecate DEFINE_PCI_DEVICE_TABLE
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 |