From 0d4cc9e32425973f436bfbcf66dacb5d7a882823 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 6 Mar 2026 15:51:46 +0000 Subject: 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 --- util/nvmutil/nvmutil.c | 4 ++-- 1 file 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 -- cgit v1.2.1