Message ID | 57396f1eacfacdb589127499f8ff64225a39e110.1667336095.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212800wru; Tue, 1 Nov 2022 14:16:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NV/RT3OI1aDz23fVBdhaCMxFv8i5Hc+pmtUaHHWUpGdDXsSExV2N/7E7Q77/ym1Iru5jJ X-Received: by 2002:a17:906:5d04:b0:77f:ca9f:33d1 with SMTP id g4-20020a1709065d0400b0077fca9f33d1mr20171086ejt.526.1667337406700; Tue, 01 Nov 2022 14:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337406; cv=none; d=google.com; s=arc-20160816; b=THCzHBNOgKQzTKuPWrMH3QBZyQ2ZH2ynWpPKYJigXQq9QrQWmscF5hxZ3q6a0kyDHX 8QJQOhISoa39AKaDqI0TTpZqtyFCxmmGsYpnuaPmm2jtbshU6G18CABebhPUTepbtdLx byV53Y+wzb8AvQMV9IsL42lPCbUkuZ7oo3K8EwPTq6f2fY5GVeZSQc+HzxwFU3nvUDKF +Wi+r62Ln3qmJRiSkPzMGvtYfzdZK6Xe6FlDPYCTLDZMDCx7Z4pgTGg6bQqsob1G/EZO duYwFD21aw5ereYwsl3RoirCs9uNCsk3vS5p3wcqGuBmM+yVT3u6w4BEWKk40nPybJli iobw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=a7um//p4JuBJaAHau0Qz8sm4t+bfwPegIelvJKc6O/M=; b=l/2ywQQZzlxcx35ltqHvvh1ZM8soRMAV5OrIdQysCS3VNbWviIXLbyGDxkaUimcegz RrO74GgIuHB23a2MtSzgeBzhHFKMJvid8WQZIXB4kTjF5ridfZ5n34Ie3I/GSLmbIOoH YYiTz/ez9zR6msUawBxUyACLavD3li99T4Jb+BvLu2lYEvwfaZMm2AigacR/iD4+VSoq 2CT54oAKZUEEZzaNSLjkFunxV2Pulsazux6UgjCtZijAZnMqen9K4GWMCvmfmxxu3A0C z1WmeBrptwLizg+UOEF1+iU6KgB3mVdJxlOap2z3FecjPse5CLuyYLH4ITphzdovI2P2 XTRg== 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 gt7-20020a1709072d8700b0078d27c1c8f4si11846194ejc.696.2022.11.01.14.16.21; Tue, 01 Nov 2022 14:16:46 -0700 (PDT) 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 S230401AbiKAVPs (ORCPT <rfc822;kartikey406@gmail.com> + 99 others); Tue, 1 Nov 2022 17:15:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbiKAVP3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 1 Nov 2022 17:15:29 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACDD81C42C for <linux-kernel@vger.kernel.org>; Tue, 1 Nov 2022 14:15:14 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybJoWfJ5; Tue, 01 Nov 2022 22:15:13 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:13 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: "Rafael J. Wysocki" <rafael@kernel.org>, Len Brown <lenb@kernel.org> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, linux-acpi@vger.kernel.org Subject: [PATCH 09/30] ACPI: sysfs: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:57 +0100 Message-Id: <57396f1eacfacdb589127499f8ff64225a39e110.1667336095.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cover.1667336095.git.christophe.jaillet@wanadoo.fr> References: <cover.1667336095.git.christophe.jaillet@wanadoo.fr> 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=unavailable 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?1748329988519623184?= X-GMAIL-MSGID: =?utf-8?q?1748329988519623184?= |
Series |
Remove strtobool()
|
|
Commit Message
Christophe JAILLET
Nov. 1, 2022, 9:13 p.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 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/
---
drivers/acpi/sysfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Tue, Nov 01, 2022 at 10:13:57PM +0100, 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>) Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > --- > 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/ > --- > drivers/acpi/sysfs.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c > index cc2fe0618178..2d81c742e4d2 100644 > --- a/drivers/acpi/sysfs.c > +++ b/drivers/acpi/sysfs.c > @@ -9,6 +9,7 @@ > #include <linux/bitmap.h> > #include <linux/init.h> > #include <linux/kernel.h> > +#include <linux/kstrtox.h> > #include <linux/moduleparam.h> > > #include "internal.h" > @@ -992,7 +993,7 @@ static ssize_t force_remove_store(struct kobject *kobj, > bool val; > int ret; > > - ret = strtobool(buf, &val); > + ret = kstrtobool(buf, &val); > if (ret < 0) > return ret; > > -- > 2.34.1 > >
On Wed, Nov 2, 2022 at 12:33 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Tue, Nov 01, 2022 at 10:13:57PM +0100, 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>) > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > > --- > > 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/ > > --- > > drivers/acpi/sysfs.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c > > index cc2fe0618178..2d81c742e4d2 100644 > > --- a/drivers/acpi/sysfs.c > > +++ b/drivers/acpi/sysfs.c > > @@ -9,6 +9,7 @@ > > #include <linux/bitmap.h> > > #include <linux/init.h> > > #include <linux/kernel.h> > > +#include <linux/kstrtox.h> > > #include <linux/moduleparam.h> > > > > #include "internal.h" > > @@ -992,7 +993,7 @@ static ssize_t force_remove_store(struct kobject *kobj, > > bool val; > > int ret; > > > > - ret = strtobool(buf, &val); > > + ret = kstrtobool(buf, &val); > > if (ret < 0) > > return ret; > > > > -- Applied as 6.2 material, thanks!
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index cc2fe0618178..2d81c742e4d2 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -9,6 +9,7 @@ #include <linux/bitmap.h> #include <linux/init.h> #include <linux/kernel.h> +#include <linux/kstrtox.h> #include <linux/moduleparam.h> #include "internal.h" @@ -992,7 +993,7 @@ static ssize_t force_remove_store(struct kobject *kobj, bool val; int ret; - ret = strtobool(buf, &val); + ret = kstrtobool(buf, &val); if (ret < 0) return ret;