Commit 02096a0c authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Richard Weinberger
Browse files

mtd: ubi: avoid expensive do_div() on 32-bit machines



The use of do_div() in ubi_nvmem_reg_read() makes calling it on
32-bit machines rather expensive. Since the 'from' variable is
known to be a 32-bit quantity, it is clearly never needed and
can be optimized into a regular division operation.

Fixes: b8a77b9a ("mtd: ubi: fix NVMEM over UBI volumes on 32-bit systems")
Fixes: 3ce48580 ("mtd: ubi: provide NVMEM layer over UBI volumes")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 299af26e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment