diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2011-05-14 12:06:36 +0200 | 
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2011-05-14 12:06:36 +0200 | 
| commit | a18f22a968de17b29f2310cdb7ba69163e65ec15 (patch) | |
| tree | a7d56d88fad5e444d7661484109758a2f436129e /scripts/checkpatch.pl | |
| parent | a1c57e0fec53defe745e64417eacdbd3618c3e66 (diff) | |
| parent | 798778b8653f64b7b2162ac70eca10367cff6ce8 (diff) | |
Merge branch 'consolidate-clksrc-i8253' of master.kernel.org:~rmk/linux-2.6-arm into timers/clocksource
Conflicts:
	arch/ia64/kernel/cyclone.c
	arch/mips/kernel/i8253.c
	arch/x86/kernel/i8253.c
Reason: Resolve conflicts so further cleanups do not conflict further
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 21 | 
1 files changed, 11 insertions, 10 deletions
| diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4c0383da1c9..d8670810db6 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1946,13 +1946,13 @@ sub process {  # printk should use KERN_* levels.  Note that follow on printk's on the  # same line do not need a level, so we use the current block context  # to try and find and validate the current printk.  In summary the current -# printk includes all preceeding printk's which have no newline on the end. +# printk includes all preceding printk's which have no newline on the end.  # we assume the first bad printk is the one to report.  		if ($line =~ /\bprintk\((?!KERN_)\s*"/) {  			my $ok = 0;  			for (my $ln = $linenr - 1; $ln >= $first_line; $ln--) {  				#print "CHECK<$lines[$ln - 1]\n"; -				# we have a preceeding printk if it ends +				# we have a preceding printk if it ends  				# with "\n" ignore it, else it is to blame  				if ($lines[$ln - 1] =~ m{\bprintk\(}) {  					if ($rawlines[$ln - 1] !~ m{\\n"}) { @@ -2044,7 +2044,7 @@ sub process {  			for (my $n = 0; $n < $#elements; $n += 2) {  				$off += length($elements[$n]); -				# Pick up the preceeding and succeeding characters. +				# Pick up the preceding and succeeding characters.  				my $ca = substr($opline, 0, $off);  				my $cc = '';  				if (length($opline) >= ($off + length($elements[$n + 1]))) { @@ -2654,11 +2654,6 @@ sub process {  			WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);  		} -# SPIN_LOCK_UNLOCKED & RW_LOCK_UNLOCKED are deprecated -		if ($line =~ /\b(SPIN_LOCK_UNLOCKED|RW_LOCK_UNLOCKED)/) { -			ERROR("Use of $1 is deprecated: see Documentation/spinlocks.txt\n" . $herecurr); -		} -  # warn about #if 0  		if ($line =~ /^.\s*\#\s*if\s+0\b/) {  			CHK("if this code is redundant consider removing it\n" . @@ -2809,9 +2804,9 @@ sub process {  			WARN("consider using a completion\n" . $herecurr);  		} -# recommend strict_strto* over simple_strto* +# recommend kstrto* over simple_strto*  		if ($line =~ /\bsimple_(strto.*?)\s*\(/) { -			WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr); +			WARN("consider using kstrto* in preference to simple_$1\n" . $herecurr);  		}  # check for __initcall(), use device_initcall() explicitly please  		if ($line =~ /^.\s*__initcall\s*\(/) { @@ -2907,6 +2902,11 @@ sub process {  		    $line =~ /DEVICE_ATTR.*S_IWUGO/ ) {  			WARN("Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);  		} + +		# Check for memset with swapped arguments +		if ($line =~ /memset.*\,(\ |)(0x|)0(\ |0|)\);/) { +			ERROR("memset size is 3rd argument, not the second.\n" . $herecurr); +		}  	}  	# If we have no input at all, then there is nothing to report on @@ -2949,6 +2949,7 @@ sub process {  		if ($rpt_cleaners) {  			print "NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or\n";  			print "      scripts/cleanfile\n\n"; +			$rpt_cleaners = 0;  		}  	} | 
