Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3089165rwi; Tue, 1 Nov 2022 15:58:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7tAul3oDEFUGz16U7/My6qK9cgVLwJ4Ko9P2KfYI6KHclMVHm/KpeHi0WKQ37vIwrqh9id X-Received: by 2002:a17:90a:c56:b0:213:d200:e958 with SMTP id u22-20020a17090a0c5600b00213d200e958mr15873022pje.6.1667343524865; Tue, 01 Nov 2022 15:58:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667343524; cv=none; d=google.com; s=arc-20160816; b=U4UySK56dBBCTUOzQjUex0rd3RDtTwq8JaabQXfaHGE7VQJGjOtGeTrXAE0GUAUtzr qicndvppOQ02lPx86jXQxOIDYPD8w9SZhzg+Rh8a03C1Aq6mdCakvu8f1R9Z3KDS+bDK hm/IocQ3Fu2j4U6WtUevoI9NeAmlkYbBaHPIbr2fGCz+M1FuLyubl9eIo+6SVugzv9dq u8CkIClEd92vuMu4RajRB6E5tqHUEBob7Avu2lTlsoQwygd7dcOtSJB/1DcVPNRh1Q5B jkv5JDDcFqIbhl3j3v+G0ZerBPuENUwLg6efX4f6F6OhXVabNgaafW2u++OUUdTNmXHT HP7A== 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=qJY692Bw6zDUt1IK51abn9LCTZncm8baAhRqzYeVnyk=; b=IbEm5ulusrZFBOk19bueWRp9YfVrVdfTSl6EXipI6etRied26jiyLutESa3sEek/dT 92RS3XzO+4HW0yZI00G6yWeMqx9pmsGMADR9iCaPZWrK2aV1RUZhmBdw9HEakRXis9+l ESzj5AH/+dg1spUPtQv6DlZar4FeFfse1b3FioRzNDlpZcw7C+lPc3lkKZmdCmtSx8GE LJaaoJlDdO0n44yzTxxmzl/hCLQUh9SppQF3GLu6NiNZo+0n/VvoGMRgzZR8ymqLRyaD U4CJFiIogymLuTK7eQsi0KvCduokORiTf8kZl0uGtmRPdJCg86XlFsRQ8OmlL6BXFiAR P6/g== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a170902d05100b00183a85a9b54si12144817pll.279.2022.11.01.15.58.32; Tue, 01 Nov 2022 15:58:44 -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 S231202AbiKAVRY (ORCPT + 96 others); Tue, 1 Nov 2022 17:17:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbiKAVQO (ORCPT ); Tue, 1 Nov 2022 17:16:14 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD6E41DF02 for ; Tue, 1 Nov 2022 14:15:35 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybdoWfMe; Tue, 01 Nov 2022 22:15:34 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:34 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 29/30] driver core: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:17 +0100 Message-Id: <02ba683a5c0716638ad8ca11e8b0fdca97c4f294.1667336095.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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: X-Mailing-List: linux-kernel@vger.kernel.org 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/base/core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index d02501933467..5f6b80329cf1 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -1628,7 +1629,7 @@ early_param("fw_devlink", fw_devlink_setup); static bool fw_devlink_strict; static int __init fw_devlink_strict_setup(char *arg) { - return strtobool(arg, &fw_devlink_strict); + return kstrtobool(arg, &fw_devlink_strict); } early_param("fw_devlink.strict", fw_devlink_strict_setup); @@ -2280,7 +2281,7 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr, { struct dev_ext_attribute *ea = to_ext_attr(attr); - if (strtobool(buf, ea->var) < 0) + if (kstrtobool(buf, ea->var) < 0) return -EINVAL; return size; @@ -2534,7 +2535,7 @@ static ssize_t online_store(struct device *dev, struct device_attribute *attr, bool val; int ret; - ret = strtobool(buf, &val); + ret = kstrtobool(buf, &val); if (ret < 0) return ret; -- 2.34.1