diff options
author | Kyungmin Park <kyungmin.park@samsung.com> | 2008-05-22 03:32:18 +0200 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-07-24 12:32:54 +0200 |
commit | cadb40ccc16a26a738f1cbc963e35b21edd93e79 (patch) | |
tree | acd1d5d02ecda07634f1c49432ddb39cd9f5d7fd /drivers/mtd/ubi/misc.c | |
parent | UBI: fix buffer padding (diff) | |
download | linux-cadb40ccc16a26a738f1cbc963e35b21edd93e79.tar.xz linux-cadb40ccc16a26a738f1cbc963e35b21edd93e79.zip |
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>
Diffstat (limited to 'drivers/mtd/ubi/misc.c')
-rw-r--r-- | drivers/mtd/ubi/misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/misc.c b/drivers/mtd/ubi/misc.c index 93e052812012..22ad31402945 100644 --- a/drivers/mtd/ubi/misc.c +++ b/drivers/mtd/ubi/misc.c @@ -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) |