mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
util/nvmutil: make swap() a bit clearer
don't sizecode. show the individual steps clearly. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -441,6 +441,10 @@ swap(int partnum) /* swaps bytes in words, not pointers. */
|
||||
size_t w, x;
|
||||
uint8_t *n = (uint8_t *) gbe[partnum];
|
||||
|
||||
for (w = nf * ((uint8_t *) &e)[0], x = 1; w < NVM_SIZE; w += 2, x += 2)
|
||||
n[w] ^= n[x], n[x] ^= n[w], n[w] ^= n[x];
|
||||
for (w = nf * ((uint8_t *) &e)[0], x = 1; w < NVM_SIZE;
|
||||
w += 2, x += 2) {
|
||||
n[w] ^= n[x];
|
||||
n[x] ^= n[w];
|
||||
n[w] ^= n[x];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user