mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
UBI: avoid unnecessary division operations
UBI already checks that @min io size is the power of 2 at io_init. It is save to use bit operations then. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
parent
a0fd1efd48
commit
cadb40ccc1
8 changed files with 18 additions and 16 deletions
|
@ -37,7 +37,7 @@ int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf,
|
|||
{
|
||||
int i;
|
||||
|
||||
ubi_assert(length % ubi->min_io_size == 0);
|
||||
ubi_assert(!(length & (ubi->min_io_size - 1)));
|
||||
|
||||
for (i = length - 1; i >= 0; i--)
|
||||
if (((const uint8_t *)buf)[i] != 0xFF)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue