util/nvmutil: make swap() a bit clearer
don't sizecode. show the individual steps clearly. Signed-off-by: Leah Rowe <leah@libreboot.org>master
parent
06f30b9543
commit
dcfde2e318
|
@ -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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue