mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mtd: ftl: Use DIV_ROUND_UP()
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. Signed-off-by: Arushi Singhal <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
This commit is contained in:
parent
c77a931206
commit
b756816dad
1 changed files with 2 additions and 2 deletions
|
|
@ -393,8 +393,8 @@ static int prepare_xfer(partition_t *part, int i)
|
|||
}
|
||||
|
||||
/* Write the BAM stub */
|
||||
nbam = (part->BlocksPerUnit * sizeof(uint32_t) +
|
||||
le32_to_cpu(part->header.BAMOffset) + SECTOR_SIZE - 1) / SECTOR_SIZE;
|
||||
nbam = DIV_ROUND_UP(part->BlocksPerUnit * sizeof(uint32_t) +
|
||||
le32_to_cpu(part->header.BAMOffset), SECTOR_SIZE);
|
||||
|
||||
offset = xfer->Offset + le32_to_cpu(part->header.BAMOffset);
|
||||
ctl = cpu_to_le32(BLOCK_CONTROL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue