mm/damon: use kstrtobool() instead of strtobool()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 1 Nov 2022 21:14:08 +0000 (22:14 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 30 Nov 2022 23:58:45 +0000 (15:58 -0800)
strtobool() is the same as kstrtobool().  However, the latter is more used
within the kernel.

In order to remove strtobool() and slightly simplify kstrtox.h, switch to
the other function name.

While at it, include the corresponding header file (<linux/kstrtox.h>)

Link: https://lkml.kernel.org/r/ed2b46489a513988688decb53850339cc228940c.1667336095.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/lru_sort.c
mm/damon/reclaim.c

index 2a532e3..7b8fce2 100644 (file)
@@ -8,6 +8,7 @@
 #define pr_fmt(fmt) "damon-lru-sort: " fmt
 
 #include <linux/damon.h>
+#include <linux/kstrtox.h>
 #include <linux/module.h>
 
 #include "modules-common.h"
@@ -241,7 +242,7 @@ static int damon_lru_sort_enabled_store(const char *val,
        bool enable;
        int err;
 
-       err = strtobool(val, &enable);
+       err = kstrtobool(val, &enable);
        if (err)
                return err;
 
index e57604b..e82631f 100644 (file)
@@ -8,6 +8,7 @@
 #define pr_fmt(fmt) "damon-reclaim: " fmt
 
 #include <linux/damon.h>
+#include <linux/kstrtox.h>
 #include <linux/module.h>
 
 #include "modules-common.h"
@@ -187,7 +188,7 @@ static int damon_reclaim_enabled_store(const char *val,
        bool enable;
        int err;
 
-       err = strtobool(val, &enable);
+       err = kstrtobool(val, &enable);
        if (err)
                return err;