From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matias Bjorling Date: Wed, 04 Nov 2015 02:27:33 +0000 Subject: Re: [patch] nvme: lightnvm: clean up a data type Message-Id: <56396D15.4020700@bjorling.me> List-Id: References: <20151103223731.GE19280@mwanda> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kernel-janitors@vger.kernel.org On 11/03/2015 11:45 PM, Busch, Keith wrote: > Looks right to me. Adding Matias for the last word. Thanks Keith and Dan. Looks good to me as well. > > On Tue, Nov 3, 2015, Dan Carpentar wrote: >> "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 >> >> 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);