[PATCH 1/5] drivers: mmc: card: Fix replaces simple_strtoul func call with kstrtoul

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes following coding style warning in file block.c

        drivers/mmc/card/block.c:279: WARNING: simple_strtoul is obsolete, use kstrtoul instead

Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@xxxxxxxxx>
---
 drivers/mmc/card/block.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index c69afb5..80f7b4b 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -274,13 +274,12 @@ static ssize_t force_ro_store(struct device *dev, struct device_attribute *attr,
 			      const char *buf, size_t count)
 {
 	int ret;
-	char *end;
 	struct mmc_blk_data *md = mmc_blk_get(dev_to_disk(dev));
-	unsigned long set = simple_strtoul(buf, &end, 0);
-	if (end == buf) {
-		ret = -EINVAL;
+	unsigned long set;
+
+	ret = kstrtoul(buf, 0, &set);
+	if ((ret == -EINVAL) || (ret == -ERANGE))
 		goto out;
-	}
 
 	set_disk_ro(dev_to_disk(dev), set || md->read_only);
 	ret = count;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux