mirror of
				https://review.coreboot.org/flashrom.git
				synced 2025-10-31 05:10:41 +01:00 
			
		
		
		
	serprog.c: Retype variable have_device with bool
				
					
				
			Use the bool type instead of an integer for the variable `have_device`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Ia12f1503ae3f7be20a065f22b4ab84c4140cd23e Reviewed-on: https://review.coreboot.org/c/flashrom/+/66878 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
		 Felix Singer
					Felix Singer
				
			
				
					committed by
					
						 Anastasia Klimchuk
						Anastasia Klimchuk
					
				
			
			
				
	
			
			
			 Anastasia Klimchuk
						Anastasia Klimchuk
					
				
			
						parent
						
							9197a44c28
						
					
				
				
					commit
					6b70aacdcd
				
			| @@ -15,6 +15,7 @@ | ||||
|  * GNU General Public License for more details. | ||||
|  */ | ||||
|  | ||||
| #include <stdbool.h> | ||||
| #include <stdio.h> | ||||
| #if ! IS_WINDOWS /* stuff (presumably) needed for sockets only */ | ||||
| #include <stdlib.h> | ||||
| @@ -571,7 +572,7 @@ static int serprog_init(const struct programmer_cfg *cfg) | ||||
| 	unsigned char rbuf[3]; | ||||
| 	unsigned char c; | ||||
| 	char *device; | ||||
| 	int have_device = 0; | ||||
| 	bool have_device = false; | ||||
|  | ||||
| 	/* the parameter is either of format "dev=/dev/device[:baud]" or "ip=ip:port" */ | ||||
| 	device = extract_programmer_param_str(cfg, "dev"); | ||||
| @@ -598,7 +599,7 @@ static int serprog_init(const struct programmer_cfg *cfg) | ||||
| 				free(device); | ||||
| 				return 1; | ||||
| 			} | ||||
| 			have_device++; | ||||
| 			have_device = true; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| @@ -637,7 +638,7 @@ static int serprog_init(const struct programmer_cfg *cfg) | ||||
| 				free(device); | ||||
| 				return 1; | ||||
| 			} | ||||
| 			have_device++; | ||||
| 			have_device = true; | ||||
| 		} | ||||
| 	} | ||||
| 	if (device && !strlen(device)) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user