mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts/checkpatch.pl: Add check for declaration of pci_device_id
@ 2010-10-22  6:30 Joe Perches
  0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2010-10-22  6:30 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: Andrew Morton, LKML

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2039acd..9929cec 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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/ &&



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-10-22  6:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-22  6:30 [PATCH] scripts/checkpatch.pl: Add check for declaration of pci_device_id Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®