mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-19 19:23:24 +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;
|
size_t w, x;
|
||||||
uint8_t *n = (uint8_t *) gbe[partnum];
|
uint8_t *n = (uint8_t *) gbe[partnum];
|
||||||
|
|
||||||
for (w = nf * ((uint8_t *) &e)[0], x = 1; w < NVM_SIZE; w += 2, x += 2)
|
for (w = nf * ((uint8_t *) &e)[0], x = 1; w < NVM_SIZE;
|
||||||
n[w] ^= n[x], n[x] ^= n[w], n[w] ^= n[x];
|
w += 2, x += 2) {
|
||||||
|
n[w] ^= n[x];
|
||||||
|
n[x] ^= n[w];
|
||||||
|
n[w] ^= n[x];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user