From patchwork Sat Jan 14 09:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 43744 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp213578wrn; Sat, 14 Jan 2023 02:01:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXsf+1bcV8FWNcLcHcfWKX8IRDsaYvAEECsHOOkmNxsS0wT+r4VfruHpv/foDRt8rFZADbV+ X-Received: by 2002:a17:907:272b:b0:866:d17a:e50 with SMTP id d11-20020a170907272b00b00866d17a0e50mr8947472ejl.70.1673690462087; Sat, 14 Jan 2023 02:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673690462; cv=none; d=google.com; s=arc-20160816; b=DHpvreH5JrBnbnrZmxV42sN/bgl2x9S3ZvL1SP5G3vcnOzFFaJkFa76vqc8mkwNxbX LFErPemGL3mNUM7Dv2YntISe0x6xFRKR/BNoDJco7AF1v8Njaaw5wGiwQ3D1nFGDlcdp /GUvAj/hJWItfwDa3wjI9MtDaTBEPug7I/KrzpA6AlL01/e9hcseLKopSG9qiQSfNpeo MKMp1HG+XRuL9sad1WaBs/oolvly6P6sTf51ITg7aLbA1M1dt2CCwJikPfH9yyraIWE4 kkekI7WZzCdwsP9jqDJj9Ni5zbuwfU/iEX12O/dzAheRroVY+oBj7FrOJ1UyRc4rbYZy GsIQ== 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 :message-id:date:subject:cc:to:from; bh=d5hLzL/p28fZSiXblPQ89CSn3io8TkhO1MI+qUZx4CY=; b=JYVcXG8xfC1t/r5fhsR5AEusUHeh2w1vNaonb1qQXl8QJixQ40MvSjB6tMDPTXb0G6 f4XvcEmDfShCFR8qqolIEplmH6bKCUaEOQnA/sCkMVPXNZrkTFXNo4JTpp4uM6aDSGV+ gTmjtUe/kI20YC+/BcBEUDFqFH69qMpLDSK8103Zz9EixHMiGtDgtgFcB2tYFH13Dcjy ZXDFtAlktQ0Brai+l2iKPtteWav4arIn22099uKjRA8htjvnBzcvW7a/HIkRcphZ7F2G 5FoAPpwvDQwkYgPkHmWiKueLVHtD9vDK9Dsz1T4bsW8a5j3XS4EcTggXYq6REBsOKZ/s Dv1g== 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 gs40-20020a1709072d2800b007829f6fed9dsi26555853ejc.232.2023.01.14.02.00.35; Sat, 14 Jan 2023 02:01:02 -0800 (PST) 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 S229758AbjANJj3 (ORCPT + 99 others); Sat, 14 Jan 2023 04:39:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbjANJjZ (ORCPT ); Sat, 14 Jan 2023 04:39:25 -0500 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D14791BF for ; Sat, 14 Jan 2023 01:39:24 -0800 (PST) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id Gd0Qp24IHA7XxGd0RpTOKO; Sat, 14 Jan 2023 10:39:23 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 14 Jan 2023 10:39:23 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Sean Christopherson , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , kvm@vger.kernel.org Subject: [PATCH v2] KVM: x86/mmu: Use kstrtobool() instead of strtobool() Date: Sat, 14 Jan 2023 10:39:11 +0100 Message-Id: <670882aa04dbdd171b46d3b20ffab87158454616.1673689135.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 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?1754991649698138165?= X-GMAIL-MSGID: =?utf-8?q?1754991649698138165?= 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 was already sent as a part of a serie ([1]) that axed all usages of strtobool(). Most of the patches have been merged in -next. I synch'ed with latest -next and re-send the remaining ones as individual patches. Changes in v2: - synch with latest -next. [1]: https://lore.kernel.org/all/cover.1667336095.git.christophe.jaillet@wanadoo.fr/ --- arch/x86/kvm/mmu/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 9c7198544195..699f7eac5070 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -6752,7 +6753,7 @@ static int set_nx_huge_pages(const char *val, const struct kernel_param *kp) new_val = 1; else if (sysfs_streq(val, "auto")) new_val = get_nx_auto_mode(); - else if (strtobool(val, &new_val) < 0) + else if (kstrtobool(val, &new_val) < 0) return -EINVAL; __set_nx_huge_pages(new_val);