Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/66878 )
Change subject: serprog.c: Retype variable `have_device` with bool ......................................................................
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 --- M serprog.c 1 file changed, 21 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Anastasia Klimchuk: Looks good to me, approved
diff --git a/serprog.c b/serprog.c index c68449a..57196a9 100644 --- a/serprog.c +++ b/serprog.c @@ -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 @@ 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 @@ free(device); return 1; } - have_device++; + have_device = true; } }
@@ -637,7 +638,7 @@ free(device); return 1; } - have_device++; + have_device = true; } } if (device && !strlen(device)) {