Skip to contentSkip to conversation

scsi: replace strict_strtoul() with kstrtoul()

PATCH In review Jingoo Han 2 participants 2 messages Jun 1, 2013 – Jun 2, 2013

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 scsi: replace strict_strtoul() with kstrtoul()

The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used.

---
 drivers/scsi/pmcraid.c    |    2 +-
 drivers/scsi/scsi_sysfs.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/pmcraid.c +1 -1
index 8e1b737..948232a 100644
@@ -4204,7 +4204,7 @@ static ssize_t pmcraid_store_log_level(
 	struct pmcraid_instance *pinstance;
 	unsigned long val;
 
-	if (strict_strtoul(buf, 10, &val))
+	if (kstrtoul(buf, 10, &val))
 		return -EINVAL;
 	/* log-level should be from 0 to 2 */
 	if (val > 2)
drivers/scsi/scsi_sysfs.c +1 -1
index 931a7d9..bf36b45 100644
@@ -790,7 +790,7 @@ sdev_store_queue_ramp_up_period(struct device *dev,
 	struct scsi_device *sdev = to_scsi_device(dev);
 	unsigned long period;
 
-	if (strict_strtoul(buf, 10, &period))
+	if (kstrtoul(buf, 10, &period))
 		return -EINVAL;
 
 	sdev->queue_ramp_up_period = msecs_to_jiffies(period);
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 7 lines · Jingoo Han

The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used.

drivers/scsi/pmcraid.c static ssize_t pmcraid_store_log_level( · line 4210

Quoted 8 lines
drivers/scsi/pmcraid.c +1 -1
@@ -4204,7 +4204,7 @@ static ssize_t pmcraid_store_log_level(
        struct pmcraid_instance *pinstance;
        unsigned long val;
 
-       if (strict_strtoul(buf, 10, &val))
+       if (kstrtoul(buf, 10, &val))
                return -EINVAL;
        /* log-level should be from 0 to 2 */
        if (val > 2)

int ret;

ret = kstrtoul(...);
if (ret)
return ret;

drivers/scsi/scsi_sysfs.c sdev_store_queue_ramp_up_period(struct device *dev, · line 794

Quoted 11 lines
drivers/scsi/scsi_sysfs.c +1 -1
index 931a7d9..bf36b45 100644
@@ -790,7 +790,7 @@ sdev_store_queue_ramp_up_period(struct device *dev,
        struct scsi_device *sdev = to_scsi_device(dev);
        unsigned long period;
 
-       if (strict_strtoul(buf, 10, &period))
+       if (kstrtoul(buf, 10, &period))
                return -EINVAL;

Ditto.

--
With Best Regards,
Andy Shevchenko