From: Matias Bjorling <m@bjorling.me>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] nvme: lightnvm: clean up a data type
Date: Wed, 04 Nov 2015 02:27:33 +0000 [thread overview]
Message-ID: <56396D15.4020700@bjorling.me> (raw)
In-Reply-To: <B58D82457FDA0744A320A2FC5AC253B93CD3C236@fmsmsx104.amr.corp.intel.com>
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 <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);
WARNING: multiple messages have this Message-ID (diff)
From: m@bjorling.me (Matias Bjorling)
Subject: [patch] nvme: lightnvm: clean up a data type
Date: Wed, 4 Nov 2015 03:27:33 +0100 [thread overview]
Message-ID: <56396D15.4020700@bjorling.me> (raw)
In-Reply-To: <B58D82457FDA0744A320A2FC5AC253B93CD3C236@fmsmsx104.amr.corp.intel.com>
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 <dan.carpenter at 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);
next prev parent reply other threads:[~2015-11-04 2:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 22:37 [patch] nvme: lightnvm: clean up a data type Dan Carpenter
2015-11-03 22:37 ` Dan Carpenter
2015-11-03 22:45 ` Busch, Keith
2015-11-03 22:45 ` Busch, Keith
2015-11-04 2:27 ` Matias Bjorling [this message]
2015-11-04 2:27 ` Matias Bjorling
2015-11-03 23:02 ` Jens Axboe
2015-11-03 23:02 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56396D15.4020700@bjorling.me \
--to=m@bjorling.me \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.