checkpatch: comment detection may miss an implied comment on the last hunk
When detecting implied comments from leading stars we may incorrectly think we have detected an edge one way or the other when we have not if we drop off the end of the last hunk. Fix this up. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
					parent
					
						
							
								691d77b6b8
							
						
					
				
			
			
				commit
				
					
						721c1cb60e
					
				
			
		
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -1097,8 +1097,8 @@ sub process {
 | 
				
			||||||
					 $rawlines[$ln - 1] =~ /^-/);
 | 
										 $rawlines[$ln - 1] =~ /^-/);
 | 
				
			||||||
				$cnt--;
 | 
									$cnt--;
 | 
				
			||||||
				#print "RAW<$rawlines[$ln - 1]>\n";
 | 
									#print "RAW<$rawlines[$ln - 1]>\n";
 | 
				
			||||||
				($edge) = (defined $rawlines[$ln - 1] &&
 | 
									last if (!defined $rawlines[$ln - 1]);
 | 
				
			||||||
					$rawlines[$ln - 1] =~ m@(/\*|\*/)@);
 | 
									($edge) = ($rawlines[$ln - 1] =~ m@(/\*|\*/)@);
 | 
				
			||||||
				last if (defined $edge);
 | 
									last if (defined $edge);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if (defined $edge && $edge eq '*/') {
 | 
								if (defined $edge && $edge eq '*/') {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue