Message ID | a0abd4f77374428bd3c9dd8b69b2afe52544c994.1673687215.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp204368wrn; Sat, 14 Jan 2023 01:26:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXu9b53XUu89DnQut/iUm+rh5st/Yl0TbF8AxyxogpAsMSpLtzr1xriHqf8pfDHMvnDpBtFJ X-Received: by 2002:aa7:c505:0:b0:46c:aec4:606f with SMTP id o5-20020aa7c505000000b0046caec4606fmr2586818edq.23.1673688366847; Sat, 14 Jan 2023 01:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673688366; cv=none; d=google.com; s=arc-20160816; b=szsMTV8l+qiL+Iptx6PKmicy0QE4+MzTDqu8ujpgJCo8CycBGdSaA0GiwEHduRTdmX j0y2lu9tyqCStQ7vzC43RckJye5J/Ti7uzosi4PaXqPVm4fUz5ekmxh6ezHbP/iIFhG3 mygDMP009Q5zNGE9QrCiU/v7Eo/PbHTtt9ktPUq/lMFXLcY11fB/VYe0V2zG45d6o1dQ cgo44aGx/SDBIXv7ezUuj009IPHLnFEVSXl4X9zIIqINheIj02+KFja37EIRWTt/HS0Q qR3cnXg6vOphWxeMHTALJS+BFj66WDHFaF96T16RZjddVwvY/1X97TCF0cyFRXo1Mtpe aboQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HRUlpypo+LUsDbDAj3Xse6gSgXDvLxA5JceE0hdSqOM=; b=sVWalT9VJP7p0HvY4qm8ZaJlxt7ogMCDY1njpgn8EQ2nuBXKgOHpANUowUMSj6WQ3b LpF3t+PLhOw2Y842Gq8opq4CNRtV6HhO/hzjHopK7azgxHApQiUCEGYheOfGmmfkvMOj XkPTUw+iur6SJ5wWOmjFK3ArH4X0aup9+Ev/O3SOPiI3op3GiptDZV7ezWkQ21ylaVoG 44a0m/aigSUWXnBxr1I1Ov6VKjhQVcZ9qJMd3eUs8RRNMDFPBhsqXYbFItGA/buYQLNb Okoo/ff7o+dWuhp7hBeyLlexrStx6PmOujRSVgCtfMsK0w6SAODBgN8qlnsYMJ0uppUb kOXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id el13-20020a056402360d00b0047df36b44f5si22011724edb.582.2023.01.14.01.25.43; Sat, 14 Jan 2023 01:26:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229752AbjANJIZ (ORCPT <rfc822;stefanalexe48@gmail.com> + 99 others); Sat, 14 Jan 2023 04:08:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjANJIW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 14 Jan 2023 04:08:22 -0500 Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C529559E6 for <linux-kernel@vger.kernel.org>; Sat, 14 Jan 2023 01:08:18 -0800 (PST) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id GcWNpZ6I1pxjIGcWNpgoWb; Sat, 14 Jan 2023 10:08:17 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 14 Jan 2023 10:08:17 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: linux@rasmusvillemoes.dk, mcgrof@kernel.org, mbenes@suse.cz, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr> Subject: [PATCH v2] kernel/params.c: Use kstrtobool() instead of strtobool() Date: Sat, 14 Jan 2023 10:08:13 +0100 Message-Id: <a0abd4f77374428bd3c9dd8b69b2afe52544c994.1673687215.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754989453029791320?= X-GMAIL-MSGID: =?utf-8?q?1754989453029791320?= |
Series |
[v2] kernel/params.c: Use kstrtobool() instead of strtobool()
|
|
Commit Message
Christophe JAILLET
Jan. 14, 2023, 9:08 a.m. UTC
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>) Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- This patch was already sent as a part of a serie ([1]) that axed all usages of strtobool(). Most of the patches have been merged in -next. I synch'ed with latest -next and re-send the remaining ones as individual patches. Note that the first version was sent to no-one, only mailing lists, because "get_maintainer.pl --nogit-fallback" returns an empty list. Changes in v2: - No change [1]: https://lore.kernel.org/all/cover.1667336095.git.christophe.jaillet@wanadoo.fr/ Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- kernel/params.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Sat, 14 Jan 2023, Christophe JAILLET wrote: > 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>) > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Luis, will you take it through your modules tree? M
On Tue, Jan 17, 2023 at 03:51:52PM +0100, Miroslav Benes wrote: > On Sat, 14 Jan 2023, Christophe JAILLET wrote: > > > 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>) > > > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > > Reviewed-by: Miroslav Benes <mbenes@suse.cz> > > Luis, will you take it through your modules tree? Yes, queued up, thanks! Luis
diff --git a/kernel/params.c b/kernel/params.c index 14d66070757b..6e34ca89ebae 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -4,6 +4,7 @@ */ #include <linux/kernel.h> +#include <linux/kstrtox.h> #include <linux/string.h> #include <linux/errno.h> #include <linux/module.h> @@ -310,7 +311,7 @@ int param_set_bool(const char *val, const struct kernel_param *kp) if (!val) val = "1"; /* One of =[yYnN01] */ - return strtobool(val, kp->arg); + return kstrtobool(val, kp->arg); } EXPORT_SYMBOL(param_set_bool);