HAL_Linux: re-fix dirty mask bug in Storage

when conversion to a single parent class was done it re-introduced a
bug that was fixed a while ago

See commit d238ff7c5d
This commit is contained in:
Andrew Tridgell 2014-11-08 11:55:55 +11:00
parent 330dab2fe3
commit 02581f4c05

View File

@ -83,10 +83,10 @@ void LinuxStorage::_storage_open(void)
void LinuxStorage::_mark_dirty(uint16_t loc, uint16_t length) void LinuxStorage::_mark_dirty(uint16_t loc, uint16_t length)
{ {
uint16_t end = loc + length; uint16_t end = loc + length;
while (loc < end) { for (uint8_t line=loc>>LINUX_STORAGE_LINE_SHIFT;
uint8_t line = (loc >> LINUX_STORAGE_LINE_SHIFT); line <= end>>LINUX_STORAGE_LINE_SHIFT;
_dirty_mask |= 1 << line; line++) {
loc += LINUX_STORAGE_LINE_SIZE; _dirty_mask |= 1U << line;
} }
} }