mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
nvme: Fixes u64 division which breaks i386 builds
Uses div_u64 for u64 division and round_down, a bitwise operation, instead of rounddown, which uses a modulus. Signed-off-by: Jon Derrick <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
8ffaadf742
commit
c45f5c9943
1 changed files with 3 additions and 2 deletions
|
|
@ -1454,8 +1454,9 @@ static int nvme_cmb_qdepth(struct nvme_dev *dev, int nr_io_queues,
|
|||
unsigned q_size_aligned = roundup(q_depth * entry_size, dev->page_size);
|
||||
|
||||
if (q_size_aligned * nr_io_queues > dev->cmb_size) {
|
||||
q_depth = rounddown(dev->cmb_size / nr_io_queues,
|
||||
dev->page_size) / entry_size;
|
||||
u64 mem_per_q = div_u64(dev->cmb_size, nr_io_queues);
|
||||
mem_per_q = round_down(mem_per_q, dev->page_size);
|
||||
q_depth = div_u64(mem_per_q, entry_size);
|
||||
|
||||
/*
|
||||
* Ensure the reduced q_depth is above some threshold where it
|
||||
|
|
|
|||
Loading…
Reference in a new issue