mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 08:44:41 +00:00 
			
		
		
		
	usb: ftdi-elan: Fix if == else warnings in ftdi_elan_respond_engine
Fixes the following coccinelle warning: ./drivers/usb/misc/ftdi-elan.c:972:10-12: WARNING: possible condition with no effect (if == else) ./drivers/usb/misc/ftdi-elan.c:983:9-11: WARNING: possible condition with no effect (if == else) ./drivers/usb/misc/ftdi-elan.c:2052:11-13: WARNING: possible condition with no effect (if == else) All these else/if branches just do the same thing actually as the last else branch, So it can be merged into the last branch. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
		
							parent
							
								
									9997ab35f4
								
							
						
					
					
						commit
						ac626ff960
					
				
					 1 changed files with 0 additions and 24 deletions
				
			
		|  | @ -959,30 +959,6 @@ read:{ | |||
| 			dev_err(&ftdi->udev->dev, "error = %d with packet_bytes = %d with total %d bytes%s\n", | ||||
| 				retval, packet_bytes, bytes_read, diag); | ||||
| 			return retval; | ||||
| 		} else if (packet_bytes == 2) { | ||||
| 			unsigned char s0 = ftdi->bulk_in_buffer[0]; | ||||
| 			unsigned char s1 = ftdi->bulk_in_buffer[1]; | ||||
| 			if (s0 == 0x31 && s1 == 0x60) { | ||||
| 				if (retry_on_empty-- > 0) { | ||||
| 					goto more; | ||||
| 				} else | ||||
| 					return 0; | ||||
| 			} else if (s0 == 0x31 && s1 == 0x00) { | ||||
| 				if (retry_on_empty-- > 0) { | ||||
| 					goto more; | ||||
| 				} else | ||||
| 					return 0; | ||||
| 			} else { | ||||
| 				if (retry_on_empty-- > 0) { | ||||
| 					goto more; | ||||
| 				} else | ||||
| 					return 0; | ||||
| 			} | ||||
| 		} else if (packet_bytes == 1) { | ||||
| 			if (retry_on_empty-- > 0) { | ||||
| 				goto more; | ||||
| 			} else | ||||
| 				return 0; | ||||
| 		} else { | ||||
| 			if (retry_on_empty-- > 0) { | ||||
| 				goto more; | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 YueHaibing
						YueHaibing