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
linux_mtd.c: Retype appropriate attributes with bool

Use the bool type instead of an integer for appropriate attributes,
since this represents their purpose much better.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I8be4e08e714047d155dcc032cc3d8dabb422b27f
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66881
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
---
M linux_mtd.c
1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/linux_mtd.c b/linux_mtd.c
index c5dc451..c0147f6 100644
--- a/linux_mtd.c
+++ b/linux_mtd.c
@@ -17,6 +17,7 @@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <mtd/mtd-user.h>
@@ -33,8 +34,8 @@

struct linux_mtd_data {
FILE *dev_fp;
- int device_is_writeable;
- int no_erase;
+ bool device_is_writeable;
+ bool no_erase;
/* Size info is presented in bytes in sysfs. */
unsigned long int total_size;
unsigned long int numeraseregions;
@@ -130,10 +131,10 @@
return 1;
if (tmp & MTD_WRITEABLE) {
/* cache for later use by write function */
- data->device_is_writeable = 1;
+ data->device_is_writeable = true;
}
if (tmp & MTD_NO_ERASE) {
- data->no_erase = 1;
+ data->no_erase = true;
}

/* Device name */

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8be4e08e714047d155dcc032cc3d8dabb422b27f
Gerrit-Change-Number: 66881
Gerrit-PatchSet: 13
Gerrit-Owner: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged