diff options
author | majianpeng <majianpeng@gmail.com> | 2012-07-27 16:07:59 +0200 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 16:07:59 +0200 |
commit | 1a66a08ae82b16eb40705ad112ff28873981af92 (patch) | |
tree | afb3a927ce42b549df8083e66cca23cd865ab80a /drivers/md/dm-exception-store.c | |
parent | dm snapshot: remove redundant assignment in merge fn (diff) | |
download | linux-1a66a08ae82b16eb40705ad112ff28873981af92.tar.xz linux-1a66a08ae82b16eb40705ad112ff28873981af92.zip |
dm: replace simple_strtoul
Replace obsolete simple_strtoul() with kstrtou8/kstrtouint.
Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-exception-store.c')
-rw-r--r-- | drivers/md/dm-exception-store.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c index aa70f7d43a1a..ebaa4f803eec 100644 --- a/drivers/md/dm-exception-store.c +++ b/drivers/md/dm-exception-store.c @@ -142,24 +142,19 @@ EXPORT_SYMBOL(dm_exception_store_type_unregister); static int set_chunk_size(struct dm_exception_store *store, const char *chunk_size_arg, char **error) { - unsigned long chunk_size_ulong; - char *value; + unsigned chunk_size; - chunk_size_ulong = simple_strtoul(chunk_size_arg, &value, 10); - if (*chunk_size_arg == '\0' || *value != '\0' || - chunk_size_ulong > UINT_MAX) { + if (kstrtouint(chunk_size_arg, 10, &chunk_size)) { *error = "Invalid chunk size"; return -EINVAL; } - if (!chunk_size_ulong) { + if (!chunk_size) { store->chunk_size = store->chunk_mask = store->chunk_shift = 0; return 0; } - return dm_exception_store_set_chunk_size(store, - (unsigned) chunk_size_ulong, - error); + return dm_exception_store_set_chunk_size(store, chunk_size, error); } int dm_exception_store_set_chunk_size(struct dm_exception_store *store, |