From: David Rientjes <rientjes@google.com>
To: Zhang Zhen <zhenzhang.zhang@huawei.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 01:31:35 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.02.1406190128190.13670@chino.kir.corp.google.com> (raw)
In-Reply-To: <53A2962B.9070904@huawei.com>
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.
--
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>
next prev parent reply other threads:[~2014-06-19 8:31 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 ` Zhang Zhen
2014-06-19 8:31 ` David Rientjes [this message]
2014-06-19 9:26 ` Zhang Zhen
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=alpine.DEB.2.02.1406190128190.13670@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=nfont@austin.ibm.com \
--cc=zhenzhang.zhang@huawei.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