summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2022-12-08 21:34:19 +0000
committerLeah Rowe <leah@libreboot.org>2022-12-08 21:34:19 +0000
commitb495aa0987a09714f94e0e035beeb216cbd5f67c (patch)
tree2f7ce0b7d4661ac690fcdede6023faa64a14ce5c /util/nvmutil
parent17fa25e5af04b121653bf588b056c1bf49afa104 (diff)
util/nvmutil: consistent parentheses on comparison
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 6df68f93..da954b32 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -182,7 +182,7 @@ cmd_setmac(const char *strMac)
if (errno != 0)
return;
goto invalid_mac_address;
- } else if ((byte == 0 && (nib == 1))) {
+ } else if ((byte == 0) && (nib == 1)) {
val8 &= 0xE;
val8 |= 2;
}
@@ -247,12 +247,12 @@ rhex(void)
static uint8_t *rbuf = NULL;
static size_t rindex = BUFSIZ;
- if ((rindex == BUFSIZ)) {
+ if (rindex == BUFSIZ) {
rindex = 0;
- if ((rbuf == NULL))
+ if (rbuf == NULL)
if ((rbuf = (uint8_t *) malloc(BUFSIZ)) == NULL)
err(1, NULL);
- if ((rfd != -1)) {
+ if (rfd != -1) {
close(rfd);
rfd = -1;
}
@@ -261,7 +261,7 @@ rhex(void)
warn("%s", "/dev/urandom");
return 16;
}
- if ((errno != 0))
+ if (errno != 0)
return 16;
}
@@ -358,7 +358,7 @@ cmd_swap(void)
part0 = validChecksum(0);
part1 = validChecksum(1);
- if ((part0 | part1)) {
+ if (part0 || part1) {
for(part0 = 0; part0 < SIZE_4KB; part0++) {
gbe[part0] ^= gbe[part1 = (part0 | SIZE_4KB)];
gbe[part1] ^= gbe[part0];