From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: David Rientjes <rientjes@google.com>
Cc: nfont@austin.ibm.com, akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm/mem-hotplug: replace simple_strtoul() with kstrtoul()
Date: Thu, 19 Jun 2014 17:26:41 +0800 [thread overview]
Message-ID: <53A2ACD1.8020405@huawei.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1406190128190.13670@chino.kir.corp.google.com>
On 2014/6/19 16:31, David Rientjes wrote:
> On Thu, 19 Jun 2014, Zhang Zhen wrote:
>
>> diff --git a/drivers/base/memory.c b/drivers/base/memory.c
>> index 89f752d..c1b118a 100644
>> --- a/drivers/base/memory.c
>> +++ b/drivers/base/memory.c
>> @@ -406,7 +406,9 @@ memory_probe_store(struct device *dev, struct device_attribute *attr,
>> int i, ret;
>> unsigned long pages_per_block = PAGES_PER_SECTION * sections_per_block;
>>
>> - phys_addr = simple_strtoull(buf, NULL, 0);
>> + ret = kstrtoull(buf, 0, phys_addr);
>> + if (ret)
>> + return -EINVAL;
>>
>> if (phys_addr & ((pages_per_block << PAGE_SHIFT) - 1))
>> return -EINVAL;
>
> Three issues:
>
> - this isn't compile tested, one of your parameters to kstrtoull() has
> the wrong type,
>
> - this disregards the error returned by kstrtoull() and returns -EINVAL
> for all possible errors, kstrtoull() returns other errors as well, and
>
> - the patch title in the subject line refers to simple_strtoul() and
> kstrtoul() which do not appear in your patch.
>
> Please fix issues and resubmit.
>
Sorry, i had made a silly mistake. I will fix and resubmit.
Thanks!
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2014-06-19 9:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1403151749-14013-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-06-19 7:50 ` [PATCH] mm/mem-hotplug: replace simple_strtoul() with kstrtoul() Zhang Zhen
2014-06-19 8:31 ` David Rientjes
2014-06-19 9:26 ` Zhang Zhen [this message]
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=53A2ACD1.8020405@huawei.com \
--to=zhenzhang.zhang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=nfont@austin.ibm.com \
--cc=rientjes@google.com \
/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 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).