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
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>
---
M 82802ab.c
1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/82802ab.c b/82802ab.c
index 1db69e6..0b4de49 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -22,6 +22,7 @@
* - Order number: 290658-004
*/

+#include <stdbool.h>
#include "flash.h"
#include "chipdrivers.h"

@@ -144,7 +145,8 @@
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 @@
msg_cdbg("locked!\n");
} else {
msg_cdbg("unlocked!\n");
- can_unlock = 1;
+ can_unlock = true;
}

/* Read block lock-bits */
@@ -168,7 +170,7 @@
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 @@
{
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 @@
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 @@
msg_cdbg("block lock at %06x is %slocked!\n", i,
bcfg ? "" : "un");
if (bcfg)
- need_unlock = 1;
+ need_unlock = true;
}

/* Reset chip */

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5dfd9ed4856c37dd70706b2dd71fbb9a8acbdf4c
Gerrit-Change-Number: 66879
Gerrit-PatchSet: 12
Gerrit-Owner: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged