linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: <clm@fb.com>, <jbacik@fb.com>, David Taylor <davidt-btrfs@yadt.co.uk>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: [PATCH v2] btrfs: replace simple_strtoull() with kstrtoull()
Date: Tue, 13 May 2014 16:36:08 +0800	[thread overview]
Message-ID: <5371D978.4050304@huawei.com> (raw)
In-Reply-To: <1399947478-11287-1-git-send-email-zhenzhang.zhang@huawei.com>

use the newer and more pleasant kstrtoull() to replace simple_strtoull(),
because simple_strtoull() is marked for obsoletion.

Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
---
 fs/btrfs/ioctl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 2ad7de9..30bcc47 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1502,11 +1502,12 @@ static noinline int btrfs_ioctl_resize(struct file *file,
 	sizestr = vol_args->name;
 	devstr = strchr(sizestr, ':');
 	if (devstr) {
-		char *end;
 		sizestr = devstr + 1;
 		*devstr = '\0';
 		devstr = vol_args->name;
-		devid = simple_strtoull(devstr, &end, 10);
+		ret = kstrtoull(devstr, 10, &devid);
+		if (ret)
+			goto out_free;
 		if (!devid) {
 			ret = -EINVAL;
 			goto out_free;
-- 
1.8.1.2


.





      parent reply	other threads:[~2014-05-13  8:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1399947478-11287-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-05-13  2:22 ` [PATCH] btrfs: replace simple_strtoul() with kstrtoul() Zhang Zhen
2014-05-13  8:36 ` 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=5371D978.4050304@huawei.com \
    --to=zhenzhang.zhang@huawei.com \
    --cc=clm@fb.com \
    --cc=davidt-btrfs@yadt.co.uk \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@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 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).