* [PATCH] btrfs: replace simple_strtoul() with kstrtoul()
[not found] <1399892355-3781-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2014-05-12 11:01 ` Zhang Zhen
2014-05-12 11:28 ` David Taylor
0 siblings, 1 reply; 4+ messages in thread
From: Zhang Zhen @ 2014-05-12 11:01 UTC (permalink / raw)
To: clm, jbacik; +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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 2ad7de9..0075b7d 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1506,7 +1506,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
sizestr = devstr + 1;
*devstr = '\0';
devstr = vol_args->name;
- devid = simple_strtoull(devstr, &end, 10);
+ devid = kstrtoul(devstr, &end, 10);
if (!devid) {
ret = -EINVAL;
goto out_free;
--
1.8.1.2
.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: replace simple_strtoul() with kstrtoul()
2014-05-12 11:01 ` [PATCH] btrfs: replace simple_strtoul() with kstrtoul() Zhang Zhen
@ 2014-05-12 11:28 ` David Taylor
2014-05-13 1:44 ` Zhang Zhen
0 siblings, 1 reply; 4+ messages in thread
From: David Taylor @ 2014-05-12 11:28 UTC (permalink / raw)
To: Zhang Zhen; +Cc: clm, jbacik, linux-btrfs
On Mon, 12 May 2014, Zhang Zhen wrote:
>use the newer and more pleasant kstrtoul() to replace simple_strtoul(),
>because simple_strtoul() is marked for obsoletion.
[...]
>- devid = simple_strtoull(devstr, &end, 10);
>+ devid = kstrtoul(devstr, &end, 10);
kstrtoul appears to take its arguments in a different order:
unsigned long long simple_strtoull(const char * cp,
char ** endp, unsigned int base);
int kstrtoul(const char *s, unsigned int base, unsigned long *res);
--
David Taylor
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: replace simple_strtoul() with kstrtoul()
2014-05-12 11:28 ` David Taylor
@ 2014-05-13 1:44 ` Zhang Zhen
0 siblings, 0 replies; 4+ messages in thread
From: Zhang Zhen @ 2014-05-13 1:44 UTC (permalink / raw)
To: clm, jbacik, linux-btrfs, David Taylor
On 2014/5/12 19:28, David Taylor wrote:
> On Mon, 12 May 2014, Zhang Zhen wrote:
>
>> use the newer and more pleasant kstrtoul() to replace simple_strtoul(),
>> because simple_strtoul() is marked for obsoletion.
> [...]
>> - devid = simple_strtoull(devstr, &end, 10);
>> + devid = kstrtoul(devstr, &end, 10);
>
> kstrtoul appears to take its arguments in a different order:
>
> unsigned long long simple_strtoull(const char * cp,
> char ** endp, unsigned int base);
>
> int kstrtoul(const char *s, unsigned int base, unsigned long *res);
>
Hi David,
You are right, i made a mistake.
I will soon send the right one .
Thanks for your reply.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [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
0 siblings, 0 replies; 4+ 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] 4+ messages in thread
end of thread, other threads:[~2014-05-13 2:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1399892355-3781-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-05-12 11:01 ` [PATCH] btrfs: replace simple_strtoul() with kstrtoul() Zhang Zhen
2014-05-12 11:28 ` David Taylor
2014-05-13 1:44 ` Zhang Zhen
[not found] <1399947478-11287-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-05-13 2:22 ` Zhang Zhen
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).