aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2012-07-27 10:07:59 -0400
committerAlasdair G Kergon <agk@redhat.com>2012-07-27 10:07:59 -0400
commit1a66a08ae82b16eb40705ad112ff28873981af92 (patch)
treeafb3a927ce42b549df8083e66cca23cd865ab80a /drivers/md/dm-crypt.c
parent70c48611024791ccf83aca6195b58a5db9325485 (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-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 3f06df59fd82..e2b32401ecc7 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1241,7 +1241,6 @@ static void kcryptd_queue_crypt(struct dm_crypt_io *io)
1241static int crypt_decode_key(u8 *key, char *hex, unsigned int size) 1241static int crypt_decode_key(u8 *key, char *hex, unsigned int size)
1242{ 1242{
1243 char buffer[3]; 1243 char buffer[3];
1244 char *endp;
1245 unsigned int i; 1244 unsigned int i;
1246 1245
1247 buffer[2] = '\0'; 1246 buffer[2] = '\0';
@@ -1250,9 +1249,7 @@ static int crypt_decode_key(u8 *key, char *hex, unsigned int size)
1250 buffer[0] = *hex++; 1249 buffer[0] = *hex++;
1251 buffer[1] = *hex++; 1250 buffer[1] = *hex++;
1252 1251
1253 key[i] = (u8)simple_strtoul(buffer, &endp, 16); 1252 if (kstrtou8(buffer, 16, &key[i]))
1254
1255 if (endp != &buffer[2])
1256 return -EINVAL; 1253 return -EINVAL;
1257 } 1254 }
1258 1255