mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
tree: Retype variable programmer_may_write
with bool
Use the bool type instead of an integer for the variable `programmer_may_write`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I69958527ae018a92f1c42734a7990d0c532dee0c Reviewed-on: https://review.coreboot.org/c/flashrom/+/66885 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
bf85c62a8d
commit
2ffc56b337
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#define _LARGEFILE64_SOURCE
|
#define _LARGEFILE64_SOURCE
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -1526,7 +1527,7 @@ static int enable_flash_ck804(const struct programmer_cfg *cfg, struct pci_dev *
|
|||||||
|
|
||||||
if (err > 0) {
|
if (err > 0) {
|
||||||
msg_pinfo("%d locks could not be disabled, disabling writes (reads may also fail).\n", err);
|
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;
|
reg = 0x88;
|
||||||
|
@ -50,7 +50,7 @@ struct decode_sizes max_rom_decode;
|
|||||||
unsigned long flashbase;
|
unsigned long flashbase;
|
||||||
|
|
||||||
/* Is writing allowed with this programmer? */
|
/* Is writing allowed with this programmer? */
|
||||||
int programmer_may_write;
|
bool programmer_may_write;
|
||||||
|
|
||||||
#define SHUTDOWN_MAXFN 32
|
#define SHUTDOWN_MAXFN 32
|
||||||
static int shutdown_fn_count = 0;
|
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. */
|
/* Registering shutdown functions is now allowed. */
|
||||||
may_register_shutdown = true;
|
may_register_shutdown = true;
|
||||||
/* Default to allowing writes. Broken programmers set this to 0. */
|
/* Default to allowing writes. Broken programmers set this to 0. */
|
||||||
programmer_may_write = 1;
|
programmer_may_write = true;
|
||||||
|
|
||||||
programmer_param = param;
|
programmer_param = param;
|
||||||
msg_pdbg("Initializing %s programmer\n", programmer->name);
|
msg_pdbg("Initializing %s programmer\n", programmer->name);
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "flash.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);
|
pci_write_long(dev, REG_FLASH_ACCESS, reg32);
|
||||||
|
|
||||||
/* Write/erase doesn't work. */
|
/* Write/erase doesn't work. */
|
||||||
programmer_may_write = 0;
|
programmer_may_write = false;
|
||||||
return register_par_master(&par_master_gfxnvidia, BUS_PARALLEL, data);
|
return register_par_master(&par_master_gfxnvidia, BUS_PARALLEL, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ struct decode_sizes {
|
|||||||
};
|
};
|
||||||
// FIXME: These need to be local, not global
|
// FIXME: These need to be local, not global
|
||||||
extern struct decode_sizes max_rom_decode;
|
extern struct decode_sizes max_rom_decode;
|
||||||
extern int programmer_may_write;
|
extern bool programmer_may_write;
|
||||||
extern unsigned long flashbase;
|
extern unsigned long flashbase;
|
||||||
unsigned int count_max_decode_exceedings(const struct flashctx *flash);
|
unsigned int count_max_decode_exceedings(const struct flashctx *flash);
|
||||||
char *extract_programmer_param_str(const struct programmer_cfg *cfg, const char *param_name);
|
char *extract_programmer_param_str(const struct programmer_cfg *cfg, const char *param_name);
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "flash.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)
|
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"
|
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"
|
"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"
|
"try to disable it temporarily but even then this might not be safe:\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user