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>
This commit is contained in:
Leah Rowe
2026-03-06 15:51:46 +00:00
parent 7950a31c79
commit 0d4cc9e324
+2 -2
View File
@@ -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