From patchwork Tue Nov 1 21:14:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212906wru; Tue, 1 Nov 2022 14:16:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pi0QdAJC2XEM1hpOr/ibUZsuu4JQD+tTStG5jJUR2CyCEVFMEuSWyDSZ1rtX96MbVqF8b X-Received: by 2002:a17:902:e851:b0:187:2127:ccb with SMTP id t17-20020a170902e85100b0018721270ccbmr12452640plg.99.1667337419191; Tue, 01 Nov 2022 14:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337419; cv=none; d=google.com; s=arc-20160816; b=kiTbN9J0f4+gxWDRw6EjWQNWA+JFkNjOys37zNWjnQ6e4yOtKxPNHcBtooRTnMCYuR 7+aWTh0H6FXaUlCaGHMr91YXNXlUMlwoa1ZTPUy7Df72dPfCK/VAvTTwUmt5j/2Mp52+ b4JIdJ+UtF+g6GYhZd0WJI/eQjzoCqtyFgdBeuuXByy5cpNr1UghBZPuXjdZx/G2J+w1 jXXRM5WphHsCSZEiW1e/B+9UYxqCJtnryLGtmxVF5z20d0cNTJRy4fZcpFDSqtEC+1Fx 1nZn1RreWpLUSlqDId2M96eGTmWWiGH4Veg/OUNsUm0nF0HH0S3f5XryS5nWGyvFDKPz ulsQ== 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=4vKYVAdFkbmag/c8DV8HEihHus8WOUMIp9jbywGlKRs=; b=LSqWUP65iktM3HcRJIsr6sd2ir21xBB12dLbdGIYPAAyEpWBGfiBXhMZuOfApRtpqN umR4+Y1sa/e19WRs9F/ZK826Uh1dLpwMdS151a2dcrEnzWx+K4CQNUICGaSkgzoEdRyo BPGPs5KrWBg1ZG+nV4cvO5d44TO31gZiPEpFgoKpYtFGPAaCZYK4VKiADmxFr9b91y6o /Q0cH3GIqJyo4Ti8c9/UfU/Uhwe6tH34VdWiFxNr5UbkA+wehqbMuU3lr3lM5RSJTEDk u1YhvPfVBpjDhaRVjpDEJITV5aZGg0YX+FMvt+aHQTgzkWm1HNCduS2ioeDCulE3Nf87 ZG0g== 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 g132-20020a636b8a000000b0045a43a568casi14110552pgc.717.2022.11.01.14.16.45; Tue, 01 Nov 2022 14:16:59 -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 S230345AbiKAVQM (ORCPT + 99 others); Tue, 1 Nov 2022 17:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230249AbiKAVPd (ORCPT ); Tue, 1 Nov 2022 17:15:33 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E672A1F2D9 for ; Tue, 1 Nov 2022 14:15:17 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybMoWfJb; Tue, 01 Nov 2022 22:15:16 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:16 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Benson Leung , Guenter Roeck Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , chrome-platform@lists.linux.dev Subject: [PATCH 13/30] platform/chrome: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:01 +0100 Message-Id: <8d66b4688c05a44b592a4d20e2660e9067163276.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=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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748330001662697260?= X-GMAIL-MSGID: =?utf-8?q?1748330001662697260?= 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/platform/chrome/cros_ec_lightbar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec_lightbar.c b/drivers/platform/chrome/cros_ec_lightbar.c index 469dfc7a4a03..58beb2a047b2 100644 --- a/drivers/platform/chrome/cros_ec_lightbar.c +++ b/drivers/platform/chrome/cros_ec_lightbar.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -493,7 +494,7 @@ static ssize_t userspace_control_store(struct device *dev, bool enable; int ret; - ret = strtobool(buf, &enable); + ret = kstrtobool(buf, &enable); if (ret < 0) return ret;