summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chipset_enable.c3
-rw-r--r--flashrom.c4
-rw-r--r--gfxnvidia.c3
-rw-r--r--include/programmer.h2
-rw-r--r--sb600spi.c3
5 files changed, 9 insertions, 6 deletions
diff --git a/chipset_enable.c b/chipset_enable.c
index e205a83d4..ae069894c 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -26,6 +26,7 @@
#define _LARGEFILE64_SOURCE
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -1526,7 +1527,7 @@ static int enable_flash_ck804(const struct programmer_cfg *cfg, struct pci_dev *
if (err > 0) {
msg_pinfo("%d locks could not be disabled, disabling writes (reads may also fail).\n", err);
- programmer_may_write = 0;
+ programmer_may_write = false;
}
reg = 0x88;
diff --git a/flashrom.c b/flashrom.c
index a1e4d2301..b68ba5539 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -50,7 +50,7 @@ struct decode_sizes max_rom_decode;
unsigned long flashbase;
/* Is writing allowed with this programmer? */
-int programmer_may_write;
+bool programmer_may_write;
#define SHUTDOWN_MAXFN 32
static int shutdown_fn_count = 0;
@@ -148,7 +148,7 @@ int programmer_init(const struct programmer_entry *prog, const char *param)
/* Registering shutdown functions is now allowed. */
may_register_shutdown = true;
/* Default to allowing writes. Broken programmers set this to 0. */
- programmer_may_write = 1;
+ programmer_may_write = true;
programmer_param = param;
msg_pdbg("Initializing %s programmer\n", programmer->name);
diff --git a/gfxnvidia.c b/gfxnvidia.c
index 941f0e8d4..ff510ef47 100644
--- a/gfxnvidia.c
+++ b/gfxnvidia.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "flash.h"
@@ -140,7 +141,7 @@ static int gfxnvidia_init(const struct programmer_cfg *cfg)
pci_write_long(dev, REG_FLASH_ACCESS, reg32);
/* Write/erase doesn't work. */
- programmer_may_write = 0;
+ programmer_may_write = false;
return register_par_master(&par_master_gfxnvidia, BUS_PARALLEL, data);
}
diff --git a/include/programmer.h b/include/programmer.h
index 776ac2113..abb7cfd64 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -286,7 +286,7 @@ struct decode_sizes {
};
// FIXME: These need to be local, not global
extern struct decode_sizes max_rom_decode;
-extern int programmer_may_write;
+extern bool programmer_may_write;
extern unsigned long flashbase;
unsigned int count_max_decode_exceedings(const struct flashctx *flash);
char *extract_programmer_param_str(const struct programmer_cfg *cfg, const char *param_name);
diff --git a/sb600spi.c b/sb600spi.c
index 40a6dbbfd..8b02b51d2 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -18,6 +18,7 @@
* GNU General Public License for more details.
*/
+#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include "flash.h"
@@ -554,7 +555,7 @@ static int handle_imc(const struct programmer_cfg *cfg, struct pci_dev *dev, enu
}
if (!amd_imc_force)
- programmer_may_write = 0;
+ programmer_may_write = false;
msg_pinfo("Writes have been disabled for safety reasons because the presence of the IMC\n"
"was detected and it could interfere with accessing flash memory. Flashrom will\n"
"try to disable it temporarily but even then this might not be safe:\n"