mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	checkpatch: improve "no space after cast" test
This --strict test previously worked only for what appeared to be cast to pointer types. Make it work for all casts. Also, there's no reason to show the previous line for this type of message, so don't. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									1574a29f8e
								
							
						
					
					
						commit
						f27c95db11
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -2260,12 +2260,12 @@ sub process { | |||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		if ($line =~ /^\+.*\*[ \t]*\)[ \t]+(?!$Assignment|$Arithmetic)/) { | ||||
| 		if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) { | ||||
| 			if (CHK("SPACING", | ||||
| 				"No space is necessary after a cast\n" . $hereprev) && | ||||
| 				"No space is necessary after a cast\n" . $herecurr) && | ||||
| 			    $fix) { | ||||
| 				$fixed[$linenr - 1] =~ | ||||
| 				    s/^(\+.*\*[ \t]*\))[ \t]+/$1/; | ||||
| 				    s/(\(\s*$Type\s*\))[ \t]+/$1/; | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Joe Perches
						Joe Perches