Skip to content
Commit dc2b3e5c authored by yangerkun's avatar yangerkun Committed by Miquel Raynal
Browse files

mtd: phram: use div_u64_rem to stop overwrite len in phram_setup

We now support user to set erase page size, and use do_div between len
and erase size to determine the reasonableness for the erase size.
However, do_div is a macro and will overwrite the value of len. Which
results a mtd device with unexcepted size. Fix it by use div_u64_rem.

Fixes: ffad5603

 ("mtd: phram: Allow the user to set the erase page size.")
Signed-off-by: default avataryangerkun <yangerkun@huawei.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210125124936.651812-1-yangerkun@huawei.com
parent b81770a7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment