4
4
* Copyright (c) 2015-2016 HGST, a Western Digital Company.
5
5
*/
6
6
#define pr_fmt (fmt ) KBUILD_MODNAME ": " fmt
7
+ #include <linux/kstrtox.h>
7
8
#include <linux/kernel.h>
8
9
#include <linux/module.h>
9
10
#include <linux/slab.h>
@@ -267,7 +268,7 @@ static ssize_t nvmet_param_pi_enable_store(struct config_item *item,
267
268
struct nvmet_port * port = to_nvmet_port (item );
268
269
bool val ;
269
270
270
- if (strtobool (page , & val ))
271
+ if (kstrtobool (page , & val ))
271
272
return - EINVAL ;
272
273
273
274
if (nvmet_is_port_enabled (port , __func__ ))
@@ -532,7 +533,7 @@ static ssize_t nvmet_ns_enable_store(struct config_item *item,
532
533
bool enable ;
533
534
int ret = 0 ;
534
535
535
- if (strtobool (page , & enable ))
536
+ if (kstrtobool (page , & enable ))
536
537
return - EINVAL ;
537
538
538
539
if (enable )
@@ -556,7 +557,7 @@ static ssize_t nvmet_ns_buffered_io_store(struct config_item *item,
556
557
struct nvmet_ns * ns = to_nvmet_ns (item );
557
558
bool val ;
558
559
559
- if (strtobool (page , & val ))
560
+ if (kstrtobool (page , & val ))
560
561
return - EINVAL ;
561
562
562
563
mutex_lock (& ns -> subsys -> lock );
@@ -579,7 +580,7 @@ static ssize_t nvmet_ns_revalidate_size_store(struct config_item *item,
579
580
struct nvmet_ns * ns = to_nvmet_ns (item );
580
581
bool val ;
581
582
582
- if (strtobool (page , & val ))
583
+ if (kstrtobool (page , & val ))
583
584
return - EINVAL ;
584
585
585
586
if (!val )
@@ -728,7 +729,7 @@ static ssize_t nvmet_passthru_enable_store(struct config_item *item,
728
729
bool enable ;
729
730
int ret = 0 ;
730
731
731
- if (strtobool (page , & enable ))
732
+ if (kstrtobool (page , & enable ))
732
733
return - EINVAL ;
733
734
734
735
if (enable )
@@ -995,7 +996,7 @@ static ssize_t nvmet_subsys_attr_allow_any_host_store(struct config_item *item,
995
996
bool allow_any_host ;
996
997
int ret = 0 ;
997
998
998
- if (strtobool (page , & allow_any_host ))
999
+ if (kstrtobool (page , & allow_any_host ))
999
1000
return - EINVAL ;
1000
1001
1001
1002
down_write (& nvmet_config_sem );
@@ -1382,7 +1383,7 @@ static ssize_t nvmet_subsys_attr_pi_enable_store(struct config_item *item,
1382
1383
struct nvmet_subsys * subsys = to_subsys (item );
1383
1384
bool pi_enable ;
1384
1385
1385
- if (strtobool (page , & pi_enable ))
1386
+ if (kstrtobool (page , & pi_enable ))
1386
1387
return - EINVAL ;
1387
1388
1388
1389
subsys -> pi_support = pi_enable ;
@@ -1511,7 +1512,7 @@ static ssize_t nvmet_referral_enable_store(struct config_item *item,
1511
1512
struct nvmet_port * port = to_nvmet_port (item );
1512
1513
bool enable ;
1513
1514
1514
- if (strtobool (page , & enable ))
1515
+ if (kstrtobool (page , & enable ))
1515
1516
goto inval ;
1516
1517
1517
1518
if (enable )
0 commit comments