From patchwork Tue Nov 1 21:14:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13891 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3215454wru; Tue, 1 Nov 2022 14:21:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5EV5QE90MG0n/soqQRVkENFmpYamjj6EizJu3ContcP/l0QC5RCPLu8VLom1e2WqqBrS5R X-Received: by 2002:a17:903:247:b0:186:dd94:bc06 with SMTP id j7-20020a170903024700b00186dd94bc06mr21243573plh.98.1667337702867; Tue, 01 Nov 2022 14:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337702; cv=none; d=google.com; s=arc-20160816; b=NaUkI5DxAP/KmXY1k6RJeAP1+Bi2tk68EHQahYbtVmjQ/FBKMQlO23I4GLFulsZmnJ Pmz3eFbrVnWfRhLqrgV1Y+2J9b/FzNxozPCosTOt25s8S6/of6BiPd1E33ySCLR1/pv+ w41LIKPB8oqLxA7k3tn7wdZzSc9qfbAHkHaABSbXPQycKZCeiBtQ8Sx8YsbUvY5ysU5C dQS8zJIhmPjluooL6ny8u9au8Br1z779/mwPwCsD3CUC9XhSdrEpkBMX/EtgVTmrb9Ti FjBghFqtiV3dorKOOvPhGdudH7IB59ZlIo2SRu3HknSmgodKoZIMfHnBX8TivsIOrcxE M2uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from; bh=GUramgyS3q4DKGp/ZnRUdf/xtJlYrRFkShFUPIYmy0Q=; b=Aqvr2gk995bWzwnKTXTXhjXtIEKBE/iWfO2th6bLtt8bBnOBozPgxJIeprkHIP+V2V IejTBSv1IPDH1WW7Odm2GpQ12PUeNEqZkHjlGhRaD+s+5Tw43glCNpPF6W5Jtah6t1a4 +TURTpFmHD4LW8l0f58rPWv4mjGPT99wIVyhneQLExqNp8V5yr/zJ6CvsRFDhqT2d9uJ AC0U1y1YKVI8CI7hVPnE/xetvKMXFv57H/QEou1w5Txo+SbS0KKmG33OKTK8CX9FqdNv 4krz5ma5a3ooKUP+EQ3emm+kdqXuKdiqF8mRgRUPgatAkZDRoxYJPQjhMgZpzjBOEH1v jLiQ== 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 e9-20020a170902e0c900b0017f829330e3si11607685pla.70.2022.11.01.14.21.29; Tue, 01 Nov 2022 14:21:42 -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 S230370AbiKAVQv (ORCPT + 99 others); Tue, 1 Nov 2022 17:16:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230324AbiKAVQG (ORCPT ); Tue, 1 Nov 2022 17:16:06 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 923E91DDDD for ; Tue, 1 Nov 2022 14:15:28 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybWoWfL4; Tue, 01 Nov 2022 22:15:26 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:26 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 23/30] test_firmware: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:11 +0100 Message-Id: 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 To: unlisted-recipients:; (no To-header on input) 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?1748330299112694676?= X-GMAIL-MSGID: =?utf-8?q?1748330299112694676?= 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/ --- lib/test_firmware.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/test_firmware.c b/lib/test_firmware.c index c82b65947ce6..b147dc687e92 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -358,7 +359,7 @@ static int test_dev_config_update_bool(const char *buf, size_t size, int ret; mutex_lock(&test_fw_mutex); - if (strtobool(buf, cfg) < 0) + if (kstrtobool(buf, cfg) < 0) ret = -EINVAL; else ret = size;