Merge pull request #7953 from davidsaada/david_is_valid_erase_fix

Fix is_valid_erase function to use get_erase_size with address
pull/8274/head
Cruz Monrreal 2018-09-27 10:20:56 -05:00 committed by GitHub
commit 6b85ec7c57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -226,8 +226,8 @@ public:
bool is_valid_erase(bd_addr_t addr, bd_size_t size) const
{
return (
addr % get_erase_size() == 0 &&
size % get_erase_size() == 0 &&
addr % get_erase_size(addr) == 0 &&
(addr + size) % get_erase_size(addr + size - 1) == 0 &&
addr + size <= this->size());
}
};