public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: replace strict_strtoul() with kstrtoul()
@ 2013-06-01  7:29 Jingoo Han
  2013-06-02 11:28 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Jingoo Han @ 2013-06-01  7:29 UTC (permalink / raw)
  To: 'James Bottomley'
  Cc: 'James Bottomley', linux-scsi, 'Jingoo Han',
	'Anil Ravindranath'

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

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/scsi/pmcraid.c    |    2 +-
 drivers/scsi/scsi_sysfs.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 8e1b737..948232a 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -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)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 931a7d9..bf36b45 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -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);
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: replace strict_strtoul() with kstrtoul()
  2013-06-01  7:29 [PATCH] scsi: replace strict_strtoul() with kstrtoul() Jingoo Han
@ 2013-06-02 11:28 ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2013-06-02 11:28 UTC (permalink / raw)
  To: Jingoo Han
  Cc: James Bottomley, James Bottomley, linux-scsi, Anil Ravindranath

On Sat, Jun 1, 2013 at 10:29 AM, Jingoo Han <jg1.han@samsung.com> wrote:
> The usage of strict_strtoul() is not preferred, because
> strict_strtoul() is obsolete. Thus, kstrtoul() should be
> used.

> --- a/drivers/scsi/pmcraid.c
> +++ b/drivers/scsi/pmcraid.c
> @@ -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;

> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index 931a7d9..bf36b45 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] scsi: replace strict_strtoul() with kstrtoul()
@ 2013-07-19  6:54 Jingoo Han
  0 siblings, 0 replies; 3+ messages in thread
From: Jingoo Han @ 2013-07-19  6:54 UTC (permalink / raw)
  To: 'James Bottomley'
  Cc: 'James Bottomley', linux-scsi, 'Jingoo Han'

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

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/scsi/pmcraid.c    |    6 ++++--
 drivers/scsi/scsi_sysfs.c |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 1eb7b028..8cd98e6 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4203,9 +4203,11 @@ static ssize_t pmcraid_store_log_level(
 	struct Scsi_Host *shost;
 	struct pmcraid_instance *pinstance;
 	unsigned long val;
+	int ret;
 
-	if (strict_strtoul(buf, 10, &val))
-		return -EINVAL;
+	ret = kstrtoul(buf, 10, &val);
+	if (ret)
+		return ret;
 	/* log-level should be from 0 to 2 */
 	if (val > 2)
 		return -EINVAL;
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 7e50061..a876e9b 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -819,9 +819,11 @@ sdev_store_queue_ramp_up_period(struct device *dev,
 {
 	struct scsi_device *sdev = to_scsi_device(dev);
 	unsigned long period;
+	int ret;
 
-	if (strict_strtoul(buf, 10, &period))
-		return -EINVAL;
+	ret = kstrtoul(buf, 10, &period);
+	if (ret)
+		return ret;
 
 	sdev->queue_ramp_up_period = msecs_to_jiffies(period);
 	return period;
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-19  6:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-01  7:29 [PATCH] scsi: replace strict_strtoul() with kstrtoul() Jingoo Han
2013-06-02 11:28 ` Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2013-07-19  6:54 Jingoo Han

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox