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
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/66878
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71480
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/serprog.c b/serprog.c
index 03c5eec..7acba36 100644
--- a/serprog.c
+++ b/serprog.c
@@ -17,6 +17,7 @@
#include "platform.h"
+#include <stdbool.h>
#include <stdio.h>
#if ! IS_WINDOWS /* stuff (presumably) needed for sockets only */
#include <stdlib.h>
@@ -362,7 +363,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("dev");
@@ -389,7 +390,7 @@
free(device);
return 1;
}
- have_device++;
+ have_device = true;
}
}
@@ -428,7 +429,7 @@
free(device);
return 1;
}
- have_device++;
+ have_device = true;
}
}
if (device && !strlen(device)) {