All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: replace simple_strtoul() with kstrtoul()
       [not found] <1399947478-11287-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2014-05-13  2:22 ` Zhang Zhen
  2014-05-13  8:36 ` [PATCH v2] btrfs: replace simple_strtoull() with kstrtoull() Zhang Zhen
  1 sibling, 0 replies; 2+ messages in thread
From: Zhang Zhen @ 2014-05-13  2:22 UTC (permalink / raw)
  To: clm, jbacik, David Taylor; +Cc: linux-btrfs

use the newer and more pleasant kstrtoul() to replace simple_strtoul(),
because simple_strtoul() 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 = kstrtoul(devstr, 10, &devid);
+		if (ret)
+			goto out_free;
 		if (!devid) {
 			ret = -EINVAL;
 			goto out_free;
-- 
1.8.1.2


.





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2] btrfs: replace simple_strtoull() with kstrtoull()
       [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
  1 sibling, 0 replies; 2+ messages in thread
From: Zhang Zhen @ 2014-05-13  8:36 UTC (permalink / raw)
  To: clm, jbacik, David Taylor; +Cc: linux-btrfs

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


.





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-13  8:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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 ` [PATCH v2] btrfs: replace simple_strtoull() with kstrtoull() Zhang Zhen

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.