kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] nvme: lightnvm: clean up a data type
@ 2015-11-03 22:37 Dan Carpenter
  2015-11-03 22:45 ` Busch, Keith
  2015-11-03 23:02 ` Jens Axboe
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-11-03 22:37 UTC (permalink / raw)
  To: kernel-janitors

"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: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 133c839..e0b7b95 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -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_nvm_command c = {};
 	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;
 	void *entries;
 	int ret = 0;
@@ -294,7 +294,7 @@ static int nvme_nvm_get_l2p_tbl(struct request_queue *q, u64 slba, u32 nlb,
 		return -ENOMEM;
 
 	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.nlb = cpu_to_le32(cmd_nlb);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-04  2:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 22:37 [patch] nvme: lightnvm: clean up a data type Dan Carpenter
2015-11-03 22:45 ` Busch, Keith
2015-11-04  2:27   ` Matias Bjorling
2015-11-03 23:02 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).