Skip to contentSkip to conversation

btrfs: replace simple_strtoul() with kstrtoul()

PATCH In review Zhang Zhen 2 participants 3 messages May 12, 2014 – May 13, 2014 1 message not in the archive Btrfs file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Zhang Zhen

author
#1 lore raw

PATCH 1/1 btrfs: replace simple_strtoul() with kstrtoul()

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

---
 fs/btrfs/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/ioctl.c +1 -1
index 2ad7de9..0075b7d 100644
@@ -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;
Signature · 4 lines
1.8.1.2


.
#2 lore raw
Quoted 2 lines · Zhang Zhen

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

[...]

fs/btrfs/ioctl.c static noinline int btrfs_ioctl_resize(struct file *file, · line 1509

Quoted 2 lines
fs/btrfs/ioctl.c +1 -1
-		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);

Signature · 1 line
David Taylor
author
#3 lore raw
Quoted 8 lines · David Taylor
Quoted 2 lines · Zhang Zhen

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

[...]

fs/btrfs/ioctl.c static noinline int btrfs_ioctl_resize(struct file *file, · line 1509

Quoted 2 lines
fs/btrfs/ioctl.c +1 -1
-        devid = simple_strtoull(devstr, &end, 10);
+        devid = kstrtoul(devstr, &end, 10);
Quoted 7 lines

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.