| From | Alexey Dobriyan <> | Subject | [PATCH 13/52] kstrtox: convert drivers/block/ | Date | Sat, 5 Feb 2011 16:20:16 +0200 |
| |
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> --- drivers/block/osdblk.c | 10 ++-------- drivers/block/rbd.c | 8 +------- 2 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/block/osdblk.c b/drivers/block/osdblk.c index 87311eb..9a645ed 100644 --- a/drivers/block/osdblk.c +++ b/drivers/block/osdblk.c @@ -596,18 +596,12 @@ static ssize_t class_osdblk_remove(struct class *c, { struct osdblk_device *osdev = NULL; int target_id, rc; - unsigned long ul; struct list_head *tmp; - rc = strict_strtoul(buf, 10, &ul); - if (rc) + rc = kstrtoint(buf, 10, &target_id); + if (rc < 0) return rc; - /* convert to int; abort if we lost anything in the conversion */ - target_id = (int) ul; - if (target_id != ul) - return -EINVAL; - /* remove object from list immediately */ mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index e1e38b1..ffe969f 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1866,18 +1866,12 @@ static ssize_t rbd_remove(struct bus_type *bus, { struct rbd_device *rbd_dev = NULL; int target_id, rc; - unsigned long ul; int ret = count; - rc = strict_strtoul(buf, 10, &ul); + rc = kstrtoint(buf, 10, &target_id); if (rc) return rc; - /* convert to int; abort if we lost anything in the conversion */ - target_id = (int) ul; - if (target_id != ul) - return -EINVAL; - mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); rbd_dev = __rbd_get_dev(target_id); -- 1.7.3.4
|