From patchwork Tue Nov 1 21:14:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212976wru; Tue, 1 Nov 2022 14:17:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79G4MFBCd+5pxxz7RuKn44FnTgigYQ/eNLmfTBu0/2udfzUJh3SKVFHchBwniReoS1YeWN X-Received: by 2002:a17:90b:378f:b0:213:acf2:13ba with SMTP id mz15-20020a17090b378f00b00213acf213bamr20470225pjb.25.1667337427522; Tue, 01 Nov 2022 14:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337427; cv=none; d=google.com; s=arc-20160816; b=h/Nkg1mmsOr/ObOn1fILA7ylMbC+NyzbwgKCD3LGO8MqvSooMs9/JkVGfE6FFk7qpq dL2Y5jbbAvYNUeW2cGqtK5S9xYckPYvUg7G6rrxnIBgXVY8ovoCdJdzOt0cYaug+/0gW FFg5R/TRrdrphoXN/btYw+AHYKiLWDyj8iOOIoBMEhNNlLLjok56PMWFn5S/3X85Zf2H O5SXoi/xsBroG26QBigRNszdJdaykhdB2Fv0dd35YFTN1D6MNC8IjoObed4jANdIUZSM u27pYCTzaewCuxP4PNkw2xVnuZxEwpmNs9LMGRRnKn4A0zs9FyflA5DdSMUEXbkLXhta 6/FQ== 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=YXBWujBHKDN2a3cmzFha6YXgWo91H1fCBGNvRq+HBek=; b=irDTeqMTj6HRn0pzYV9DCjcn36ZydXdf6h00NtnDbP9y96ULyptTE7O6clj3KfOieR 3ZY29bAa0lNBjSxqAWgRYCBTTEldt9LZgNX/NjJVVZQ4JPzJJT2YzpEeEOII617MLSzl wk358BZVo+Tw1EyIQoAtVmEYLRZFmtIOjZuckN/CqLYKOHzL9tzPN44rGaEhAKNzlB0q DlCnmd5OIBVCZpIKh01VybsrVpNRgp2Vr1U/M7IsVCncVwEAMk8Kddc7Rp4OrE6W0Tbv BCkkJmhIQ33nL9VkeJ1j+DBPs1a7ke6g7fCuHo89X40H/UyKS9qKsGSkMU35XdZPioEh Lqjw== 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 d15-20020a63f24f000000b0043908386679si4535691pgk.373.2022.11.01.14.16.54; Tue, 01 Nov 2022 14:17:07 -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 S230488AbiKAVQO (ORCPT + 99 others); Tue, 1 Nov 2022 17:16:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230258AbiKAVPf (ORCPT ); Tue, 1 Nov 2022 17:15:35 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F27EF1F2EF for ; Tue, 1 Nov 2022 14:15:22 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybRoWfKB; Tue, 01 Nov 2022 22:15:21 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:21 +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 17/30] initramfs: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:05 +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=ham 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?1748330010545219860?= X-GMAIL-MSGID: =?utf-8?q?1748330010545219860?= 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/ --- init/initramfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init/initramfs.c b/init/initramfs.c index 62321883fe61..174e15236c8e 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -571,7 +572,12 @@ __setup("keepinitrd", keepinitrd_setup); static bool __initdata initramfs_async = true; static int __init initramfs_async_setup(char *str) { - strtobool(str, &initramfs_async); + int ret; + + ret = kstrtobool(str, &initramfs_async); + if (ret) + return 0; + return 1; } __setup("initramfs_async=", initramfs_async_setup);