From patchwork Tue Nov 1 21:14:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212888wru; Tue, 1 Nov 2022 14:16:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zAdXD8H8K6QajA5qjFT22+aQTOtyScg3NnuKBBR0T6e8vyPJXk8Qa2MR/q3GGpMMeSyr5 X-Received: by 2002:a63:1709:0:b0:46f:f8e0:4b5d with SMTP id x9-20020a631709000000b0046ff8e04b5dmr2999984pgl.368.1667337416681; Tue, 01 Nov 2022 14:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337416; cv=none; d=google.com; s=arc-20160816; b=mNWOvoxtj3C+mtiT2O0o1lIgSGXuPSdC04X3KyHgXe6tCqKX5GAZzoXK5luTfavO0W 7F6IoxluoyhH32mbie7cKlYoGciA6OyIUcSY0O7/vjiDJ2RPBzShU6aPQRMdmbGO8NdH lvho77s1GUH8+VzBK+s1syh2XHGR6fhSrmWh6mEUd6coPZnDzRyAFz6Vc3dQYN4RtMs9 CFU7q4ctmiuO3qGe+kQfChQHiMQTdZ378p04hQmEZlmFj2NV/R2VvXXRhi7eB8RT0Ji5 y32+/Rd+rJvtKASVoUVkYYwKNvj67Vn7a6Z056iXTI3FoaN4QiulKmc/9Ajrn3GFdUsT n3rA== 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=/qQvwcJvCftC4L7VR70xASdSdyEp8r8/2h7Y8zW9BSg=; b=cCcJfyfgt0J/aZTmO/5L7bsLQ+c9VPuvaCC64OOyoGHpUWebLQ1rT3LL9BeXbtcznV 1G8i0UetxeKBiBcn1dQK1jqbDjUI19flwwdpNlWyAv9Ru/HOptqBTmWH5BmRihpUhM25 MLPQsXeAA7SW5JVmbpR9VgMu80jNF9BEHLGBifPNPSUvIQaj33Ol6hxRiS5/yZs4aE4m idUFS3R/tGIlmB2L07nTu1zG0JPAJjKICbmeCB4gSCkENUUHFTE8qBf49W56tj8RFRnp Qk4qMXHnMfQd1iAD9Nco64VBgkfAk9S55VW+vnaQyorHjr0q9Z3N989OKyzLAmxhs2/s MFcw== 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 m11-20020aa78a0b000000b0056cac533dfdsi12050041pfa.261.2022.11.01.14.16.43; Tue, 01 Nov 2022 14:16:56 -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 S230343AbiKAVQJ (ORCPT + 99 others); Tue, 1 Nov 2022 17:16:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230327AbiKAVPd (ORCPT ); Tue, 1 Nov 2022 17:15:33 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 982FA1F2E1 for ; Tue, 1 Nov 2022 14:15:18 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybNoWfJh; Tue, 01 Nov 2022 22:15:17 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:17 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-pm@vger.kernel.org Subject: [PATCH 14/30] powercap: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:02 +0100 Message-Id: <652abbd70fca17977135754901135a6dad5d636c.1667336095.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748329999027380251?= X-GMAIL-MSGID: =?utf-8?q?1748329999027380251?= 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 --- 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/powercap/powercap_sys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c index f0654a932b37..1f968353d479 100644 --- a/drivers/powercap/powercap_sys.c +++ b/drivers/powercap/powercap_sys.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -446,7 +447,7 @@ static ssize_t enabled_store(struct device *dev, { bool mode; - if (strtobool(buf, &mode)) + if (kstrtobool(buf, &mode)) return -EINVAL; if (dev->parent) { struct powercap_zone *power_zone = to_powercap_zone(dev);