lkml.org 
[lkml]   [2010]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 15/45] kstrtox: convert drivers/block/
    Date

    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 008d4a0..e3baf92 100644
    --- a/drivers/block/rbd.c
    +++ b/drivers/block/rbd.c
    @@ -1855,18 +1855,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.2.2


    \
     
     \ /
      Last update: 2010-12-05 18:55    [W:0.023 / U:61.928 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site