From patchwork Tue Nov 1 21:14:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13027478 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EC4EC433FE for ; Tue, 1 Nov 2022 21:15:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 698D86B0071; Tue, 1 Nov 2022 17:15:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 648D86B0073; Tue, 1 Nov 2022 17:15:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5107E6B0074; Tue, 1 Nov 2022 17:15:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3FB396B0071 for ; Tue, 1 Nov 2022 17:15:26 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EB6E514096E for ; Tue, 1 Nov 2022 21:15:25 +0000 (UTC) X-FDA: 80086129410.08.EB00990 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by imf06.hostedemail.com (Postfix) with ESMTP id 79BE9180012 for ; Tue, 1 Nov 2022 21:15:25 +0000 (UTC) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybToWfKU; Tue, 01 Nov 2022 22:15:24 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:24 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: SeongJae Park , Andrew Morton Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , damon@lists.linux.dev, linux-mm@kvack.org Subject: [PATCH 20/30] mm/damon: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:08 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of christophe.jaillet@wanadoo.fr designates 80.12.242.16 as permitted sender) smtp.mailfrom=christophe.jaillet@wanadoo.fr; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667337325; a=rsa-sha256; cv=none; b=R8cZOE8PkZFwd25LXhU+i3SGcM3x5HXii/cMO7phkiIzxkz+z3ThDlCB26Zv1eBf1zHG5a Ya8K+xv9Czk2r4QU7XqlmR7Qu5e5/1/B1Kd0iX5I/JDqChXoBrYJ1xyfGbAGpQ4506CzwV t7sbeL6/KCjo9N9qgXSegP/v8eOystQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667337325; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X5psvRSj26Xy4mfCNSxtmrWL90PAhEIbVrMEtk5ocRo=; b=WM+WMjrxUAm/PswcbH8rsRt6f3EvH02ObqBggZcPosujN0+ICcqngvdFLLnDSPjoiJDyyK tEn63lsR2eY+8Kj9uLNR+8Tb59YBFFjtWB0fowPtOET+hnFIJiC4va4YWyrMZJNEN5/OoZ 6j4wkgGfLDwU0/dv3yRro4eRumav0TY= X-Stat-Signature: h68yrgirsgzxu5n3rgcegmkxppabpu85 X-Rspamd-Queue-Id: 79BE9180012 Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of christophe.jaillet@wanadoo.fr designates 80.12.242.16 as permitted sender) smtp.mailfrom=christophe.jaillet@wanadoo.fr; dmarc=none X-Rspamd-Server: rspam03 X-Rspam-User: X-HE-Tag: 1667337325-842146 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 () Signed-off-by: Christophe JAILLET Reviewed-by: SeongJae Park --- This patch is part of a serie that axes all usages of strtobool(). Each patch can be applied independently from the other ones. The last patch of the serie removes the definition of strtobool(). You may not be in copy of the cover letter. So, if needed, it is available at [1]. [1]: https://lore.kernel.org/all/cover.1667336095.git.christophe.jaillet@wanadoo.fr/ --- mm/damon/lru_sort.c | 3 ++- mm/damon/reclaim.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c index 2a532e3983df..7b8fce2f67a8 100644 --- a/mm/damon/lru_sort.c +++ b/mm/damon/lru_sort.c @@ -8,6 +8,7 @@ #define pr_fmt(fmt) "damon-lru-sort: " fmt #include +#include #include #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; diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index e57604bec06d..e82631f39481 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -8,6 +8,7 @@ #define pr_fmt(fmt) "damon-reclaim: " fmt #include +#include #include #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;