Anastasia Klimchuk submitted this change.

View Change


Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Anastasia Klimchuk: Looks good to me, approved
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(-)

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)) {

To view, visit change 66878. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia12f1503ae3f7be20a065f22b4ab84c4140cd23e
Gerrit-Change-Number: 66878
Gerrit-PatchSet: 17
Gerrit-Owner: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged