Skip to content

Commit

Permalink
mm/damon: use kstrtobool() instead of strtobool()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: SeongJae Park <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
tititiou36 authored and akpm00 committed Nov 30, 2022
1 parent 1b0006d commit e6aff38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mm/damon/lru_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion mm/damon/reclaim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit e6aff38

Please sign in to comment.