Commit 5f436e5e authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Axboe

nvme: lightnvm: clean up a data type

"nlb_pr_rq" can't be more than u32 because "len" is a u32.  Later we
truncate it to u32 anyway when we calculate min_t().
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent b7ceb7d5
...@@ -282,7 +282,7 @@ static int nvme_nvm_get_l2p_tbl(struct request_queue *q, u64 slba, u32 nlb, ...@@ -282,7 +282,7 @@ static int nvme_nvm_get_l2p_tbl(struct request_queue *q, u64 slba, u32 nlb,
struct nvme_dev *dev = ns->dev; struct nvme_dev *dev = ns->dev;
struct nvme_nvm_command c = {}; struct nvme_nvm_command c = {};
u32 len = queue_max_hw_sectors(q) << 9; u32 len = queue_max_hw_sectors(q) << 9;
u64 nlb_pr_rq = len / sizeof(u64); u32 nlb_pr_rq = len / sizeof(u64);
u64 cmd_slba = slba; u64 cmd_slba = slba;
void *entries; void *entries;
int ret = 0; int ret = 0;
...@@ -294,7 +294,7 @@ static int nvme_nvm_get_l2p_tbl(struct request_queue *q, u64 slba, u32 nlb, ...@@ -294,7 +294,7 @@ static int nvme_nvm_get_l2p_tbl(struct request_queue *q, u64 slba, u32 nlb,
return -ENOMEM; return -ENOMEM;
while (nlb) { while (nlb) {
u32 cmd_nlb = min_t(u32, nlb_pr_rq, nlb); u32 cmd_nlb = min(nlb_pr_rq, nlb);
c.l2p.slba = cpu_to_le64(cmd_slba); c.l2p.slba = cpu_to_le64(cmd_slba);
c.l2p.nlb = cpu_to_le32(cmd_nlb); c.l2p.nlb = cpu_to_le32(cmd_nlb);
......
Markdown is supported
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