linux-next: manual merge of the akpm-current tree with the pci tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in
scripts/checkpatch.pl between commit 92e112fdbb3c ("PCI/checkpatch:
Deprecate DEFINE_PCI_DEVICE_TABLE") from the pci tree and commit
369353832de3 ("checkpatch.pl: check for function declarations without
arguments") from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@xxxxxxxxxxxxxxxx

diff --cc scripts/checkpatch.pl
index 9fb30b15c9dc,8f3aecd3e27b..000000000000
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@@ -2634,13 -2630,19 +2630,22 @@@ sub process 
  				$herecurr);
                 }
  
+ # check for function declarations without arguments like "int foo()"
+ 		if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) {
+ 			if (ERROR("FUNCTION_WITHOUT_ARGS",
+ 				  "Bad function definition - $1() should probably be $1(void)\n" . $herecurr) &&
+ 			    $fix) {
+ 				$fixed[$linenr - 1] =~ s/(\b($Type)\s+($Ident))\s*\(\s*\)/$2 $3(void)/;
+ 			}
+ 		}
+ 
 -# check for declarations of struct pci_device_id
 -		if ($line =~ /\bstruct\s+pci_device_id\s+\w+\s*\[\s*\]\s*\=\s*\{/) {
 -			WARN("DEFINE_PCI_DEVICE_TABLE",
 -			     "Use DEFINE_PCI_DEVICE_TABLE for struct pci_device_id\n" . $herecurr);
 +# check for uses of DEFINE_PCI_DEVICE_TABLE
 +		if ($line =~ /\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/) {
 +			if (WARN("DEFINE_PCI_DEVICE_TABLE",
 +				 "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) &&
 +			    $fix) {
 +				$fixed[$linenr - 1] =~ s/\b(?:static\s+|)DEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=\s*/static const struct pci_device_id $1\[\] = /;
 +			}
  		}
  
  # check for new typedefs, only function parameters and sparse annotations

Attachment: pgp96N7NSnYF8.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux