summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-06 15:51:46 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-06 15:51:46 +0000
commit0d4cc9e32425973f436bfbcf66dacb5d7a882823 (patch)
tree6eaaf7a0938dc3b0f3f9262af0835a0e72b20008 /util/nvmutil/nvmutil.c
parent7950a31c793f2b0ab225931d3e82d0fa087c8e02 (diff)
util/nvmutil: clearer macbuff init in set_mac_nib
and 1 does the same thing as mod 2, but it's cleaner. i also now bitshift 3 times instead of times by 8, which again is clearer in purpose. i line breaked after h, to make it clear that all of the next part is being shifted in Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r--util/nvmutil/nvmutil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 93f03d4a..7df4657b 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -412,8 +412,8 @@ set_mac_nib(int mac_pos, int nib)
h = (h & 0xE) | 2; /* local, unicast */
}
- macbuf[byte >> 1] |= (uint16_t)h << ((8 * (byte % 2)) +
- (4 * (nib ^ 1)));
+ macbuf[byte >> 1] |= (uint16_t)h <<
+ (((byte & 1) << 3) + (4 * (nib ^ 1)));
}
static uint8_t