mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
UPSTREAM: mm/damon: use kstrtobool() instead of strtobool()
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>
(cherry picked from commit e6aff38b2e)
Bug: 300502883
Change-Id: I21df914f9ba754921bdc00d8e9a33e77b2606360
Signed-off-by: cui yangpei <cuiyangpei@xiaomi.com>
This commit is contained in:
committed by
Suren Baghdasaryan
parent
5bf7b56860
commit
3ca21ef5fa
@@ -8,6 +8,7 @@
|
|||||||
#define pr_fmt(fmt) "damon-lru-sort: " fmt
|
#define pr_fmt(fmt) "damon-lru-sort: " fmt
|
||||||
|
|
||||||
#include <linux/damon.h>
|
#include <linux/damon.h>
|
||||||
|
#include <linux/kstrtox.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
|
||||||
#include "modules-common.h"
|
#include "modules-common.h"
|
||||||
@@ -241,7 +242,7 @@ static int damon_lru_sort_enabled_store(const char *val,
|
|||||||
bool enable;
|
bool enable;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = strtobool(val, &enable);
|
err = kstrtobool(val, &enable);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#define pr_fmt(fmt) "damon-reclaim: " fmt
|
#define pr_fmt(fmt) "damon-reclaim: " fmt
|
||||||
|
|
||||||
#include <linux/damon.h>
|
#include <linux/damon.h>
|
||||||
|
#include <linux/kstrtox.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
|
||||||
#include "modules-common.h"
|
#include "modules-common.h"
|
||||||
@@ -187,7 +188,7 @@ static int damon_reclaim_enabled_store(const char *val,
|
|||||||
bool enable;
|
bool enable;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = strtobool(val, &enable);
|
err = kstrtobool(val, &enable);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user