Patchwork libata: replace strict_strtol() with kstrtol()

login
register
mail settings
Submitter Jingoo Han
Date July 19, 2013, 6:56 a.m.
Message ID <000901ce844d$1fa1aac0$5ee50040$@samsung.com>
Download mbox | patch
Permalink /patch/260190/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Jingoo Han - July 19, 2013, 6:56 a.m.
The usage of strict_strtol() is not preferred, because
strict_strtol() is obsolete. Thus, kstrtol() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/ata/libata-scsi.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Tejun Heo - July 22, 2013, 8:15 p.m.
On Fri, Jul 19, 2013 at 03:56:41PM +0900, Jingoo Han wrote:
> The usage of strict_strtol() is not preferred, because
> strict_strtol() is obsolete. Thus, kstrtol() should be
> used.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied to libata/for-3.11-fixes.

Thanks!

Patch

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 83c0890..b1e880a 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -206,8 +206,10 @@  static ssize_t ata_scsi_park_store(struct device *device,
 	unsigned long flags;
 	int rc;
 
-	rc = strict_strtol(buf, 10, &input);
-	if (rc || input < -2)
+	rc = kstrtol(buf, 10, &input);
+	if (rc)
+		return rc;
+	if (input < -2)
 		return -EINVAL;
 	if (input > ATA_TMOUT_MAX_PARK) {
 		rc = -EOVERFLOW;