[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190625175517.31133-1-florian.knauf@stud.uni-hannover.de>
Date: Tue, 25 Jun 2019 19:55:17 +0200
From: Florian Knauf <florian.knauf@...d.uni-hannover.de>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@....com>
Cc: linux-kernel@...cs.fau.de, Jens Axboe <axboe@...nel.dk>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Florian Knauf <florian.knauf@...d.uni-hannover.de>,
Christian Ewert <christian.ewert@...d.uni-hannover.de>
Subject: [PATCH v2] drivers/block/loop: Replace deprecated function in option parsing code
This patch removes the deprecated simple_strtol function from the option
parsing logic in the loopback device driver. Instead kstrtoint is used to
parse int max_loop, to ensure that input values it cannot represent are
ignored.
Signed-off-by: Florian Knauf <florian.knauf@...d.uni-hannover.de>
Signed-off-by: Christian Ewert <christian.ewert@...d.uni-hannover.de>
---
Thank you for your feedback.
There's no specific reason to use kstrtol, other than the fact that we
weren't yet aware that kstrtoint exists. (We're new at this, I'm afraid.)
We've amended the patch to make use of kstrtoint, which is of course much
more straightforward.
drivers/block/loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 102d79575895..adfaf4ad37d1 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -2289,7 +2289,7 @@ module_exit(loop_exit);
#ifndef MODULE
static int __init max_loop_setup(char *str)
{
- max_loop = simple_strtol(str, NULL, 0);
+ kstrtoint(str, 0, &max_loop);
return 1;
}
--
2.17.1
Powered by blists - more mailing lists