[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1296915654-7458-13-git-send-email-adobriyan@gmail.com>
Date: Sat, 5 Feb 2011 16:20:16 +0200
From: Alexey Dobriyan <adobriyan@...il.com>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, adobriyan@...il.com
Subject: [PATCH 13/52] kstrtox: convert drivers/block/
Signed-off-by: Alexey Dobriyan <adobriyan@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists