diff options
author | majianpeng <majianpeng@gmail.com> | 2012-07-27 10:07:59 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 10:07:59 -0400 |
commit | 1a66a08ae82b16eb40705ad112ff28873981af92 (patch) | |
tree | afb3a927ce42b549df8083e66cca23cd865ab80a /drivers/md/dm-exception-store.c | |
parent | 70c48611024791ccf83aca6195b58a5db9325485 (diff) |
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); | |||
142 | static int set_chunk_size(struct dm_exception_store *store, | 142 | static int set_chunk_size(struct dm_exception_store *store, |
143 | const char *chunk_size_arg, char **error) | 143 | const char *chunk_size_arg, char **error) |
144 | { | 144 | { |
145 | unsigned long chunk_size_ulong; | 145 | unsigned chunk_size; |
146 | char *value; | ||
147 | 146 | ||
148 | chunk_size_ulong = simple_strtoul(chunk_size_arg, &value, 10); | 147 | if (kstrtouint(chunk_size_arg, 10, &chunk_size)) { |
149 | if (*chunk_size_arg == '\0' || *value != '\0' || | ||
150 | chunk_size_ulong > UINT_MAX) { | ||
151 | *error = "Invalid chunk size"; | 148 | *error = "Invalid chunk size"; |
152 | return -EINVAL; | 149 | return -EINVAL; |
153 | } | 150 | } |
154 | 151 | ||
155 | if (!chunk_size_ulong) { | 152 | if (!chunk_size) { |
156 | store->chunk_size = store->chunk_mask = store->chunk_shift = 0; | 153 | store->chunk_size = store->chunk_mask = store->chunk_shift = 0; |
157 | return 0; | 154 | return 0; |
158 | } | 155 | } |
159 | 156 | ||
160 | return dm_exception_store_set_chunk_size(store, | 157 | return dm_exception_store_set_chunk_size(store, chunk_size, error); |
161 | (unsigned) chunk_size_ulong, | ||
162 | error); | ||
163 | } | 158 | } |
164 | 159 | ||
165 | int dm_exception_store_set_chunk_size(struct dm_exception_store *store, | 160 | int dm_exception_store_set_chunk_size(struct dm_exception_store *store, |