1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 07:02:34 +02:00

82802ab.c: Retype appropriate variables with bool

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

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I5dfd9ed4856c37dd70706b2dd71fbb9a8acbdf4c
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66879
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:
Felix Singer 2022-08-19 02:36:28 +02:00 committed by Anastasia Klimchuk
parent 6b70aacdcd
commit b99d99657d

View File

@ -22,6 +22,7 @@
* - Order number: 290658-004
*/
#include <stdbool.h>
#include "flash.h"
#include "chipdrivers.h"
@ -144,7 +145,8 @@ int write_82802ab(struct flashctx *flash, const uint8_t *src, unsigned int start
int unlock_28f004s5(struct flashctx *flash)
{
chipaddr bios = flash->virtual_memory;
uint8_t mcfg, bcfg, need_unlock = 0, can_unlock = 0;
uint8_t mcfg, bcfg;
bool need_unlock = false, can_unlock = false;
unsigned int i;
/* Clear status register */
@ -160,7 +162,7 @@ int unlock_28f004s5(struct flashctx *flash)
msg_cdbg("locked!\n");
} else {
msg_cdbg("unlocked!\n");
can_unlock = 1;
can_unlock = true;
}
/* Read block lock-bits */
@ -168,7 +170,7 @@ int unlock_28f004s5(struct flashctx *flash)
bcfg = chip_readb(flash, bios + i + 2); // read block lock config
msg_cdbg("block lock at %06x is %slocked!\n", i, bcfg ? "" : "un");
if (bcfg) {
need_unlock = 1;
need_unlock = true;
}
}
@ -197,7 +199,7 @@ int unlock_lh28f008bjt(struct flashctx *flash)
{
chipaddr bios = flash->virtual_memory;
uint8_t mcfg, bcfg;
uint8_t need_unlock = 0, can_unlock = 0;
bool need_unlock = false, can_unlock = false;
unsigned int i;
/* Wait if chip is busy */
@ -213,7 +215,7 @@ int unlock_lh28f008bjt(struct flashctx *flash)
msg_cdbg("locked!\n");
} else {
msg_cdbg("unlocked!\n");
can_unlock = 1;
can_unlock = true;
}
/* Read block lock-bits, 8 * 8 KB + 15 * 64 KB */
@ -223,7 +225,7 @@ int unlock_lh28f008bjt(struct flashctx *flash)
msg_cdbg("block lock at %06x is %slocked!\n", i,
bcfg ? "" : "un");
if (bcfg)
need_unlock = 1;
need_unlock = true;
}
/* Reset chip */