scripts/checkpatch.pl: Don't allow special cases of unspaced operators
The checkpatch.pl script has a special case to permit the following operators to have no spaces around them: << >> & ^ | + - * / % QEMU style prefers all operators to consistently have spacing around them, so remove this special case handling. This avoids reviewers having to manually note it during code review. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
		
							parent
							
								
									a2a645d967
								
							
						
					
					
						commit
						8f32510f1c
					
				@ -1890,19 +1890,6 @@ sub process {
 | 
				
			|||||||
						ERROR("space prohibited after that '$op' $at\n" . $hereptr);
 | 
											ERROR("space prohibited after that '$op' $at\n" . $hereptr);
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
				# << and >> may either have or not have spaces both sides
 | 
					 | 
				
			||||||
				} elsif ($op eq '<<' or $op eq '>>' or
 | 
					 | 
				
			||||||
					 $op eq '&' or $op eq '^' or $op eq '|' or
 | 
					 | 
				
			||||||
					 $op eq '+' or $op eq '-' or
 | 
					 | 
				
			||||||
					 $op eq '*' or $op eq '/' or
 | 
					 | 
				
			||||||
					 $op eq '%')
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) {
 | 
					 | 
				
			||||||
						ERROR("need consistent spacing around '$op' $at\n" .
 | 
					 | 
				
			||||||
							$hereptr);
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				# A colon needs no spaces before when it is
 | 
									# A colon needs no spaces before when it is
 | 
				
			||||||
				# terminating a case value or a label.
 | 
									# terminating a case value or a label.
 | 
				
			||||||
				} elsif ($opv eq ':C' || $opv eq ':L') {
 | 
									} elsif ($opv eq ':C' || $opv eq ':L') {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user