[PATCH 13/52] kstrtox: convert drivers/block/

From: Alexey Dobriyan
Date: Sat Feb 05 2011 - 09:29:46 EST



Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/