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>
This commit is contained in:

committed by
Alasdair G Kergon

parent
70c4861102
commit
1a66a08ae8
@@ -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,
|
||||
|
Reference in New Issue
Block a user