From a715893e02195b0f96f15147fbcd612a29e05f44 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Fri, 19 Aug 2022 02:40:39 +0200 Subject: 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 Change-Id: I8be4e08e714047d155dcc032cc3d8dabb422b27f Reviewed-on: https://review.coreboot.org/c/flashrom/+/66881 Reviewed-by: Anastasia Klimchuk Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- linux_mtd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'linux_mtd.c') diff --git a/linux_mtd.c b/linux_mtd.c index c5dc4511..c0147f68 100644 --- a/linux_mtd.c +++ b/linux_mtd.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -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 @@ static int get_mtd_info(const char *sysfs_path, struct linux_mtd_data *data) 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 */ -- cgit v1.2.3