From patchwork Tue Nov 1 21:14:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13894 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3216255wru; Tue, 1 Nov 2022 14:23:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5fVv0Rn8quLXs180edtST8CIZ6VhYI10qz7WfuPwnXSoTZJl+FlSK+A8Szh6Q9XoFMdVIL X-Received: by 2002:a17:907:8a24:b0:78d:cd60:1022 with SMTP id sc36-20020a1709078a2400b0078dcd601022mr20199840ejc.384.1667337798902; Tue, 01 Nov 2022 14:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337798; cv=none; d=google.com; s=arc-20160816; b=A+nf+/+F5tj7e/g5ptpPyZaVWxmPO5AXr0W19QpSk1jukCsq+tMzstgUYLzUjzcNMj eVrL+SfIVG4pItylW/S0TFZbyOBF8uGRMtk+FwYI6OYxCq5+OQoMf7rmp3P3ZyOrNaUQ JofWYI3CgxQK2VgKZMReOTVoYC7b/fAavhI1qelDd8eh05LUBh/NxJuKLFVaL9zo/hJM R70dm160nUvy4wPanQ45v0d/q44LFW+JvoNMsrtKMmq5BxgQi9jhm53wD9yAw7O/hieR RyRRv4gzS0C97vxSJipNwi8gcIir5yhAvQeMDzzQk0G/btuwmPcxMyYjWVjqlpw3US2U /nmQ== 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=CN8+PtlO7KiOsINtYgE/A8l2E4VA3JanE9meLumoh4o=; b=P53tYyjL7YYgFP4OYmHqcuPzSyAt/V1CahXRO7klRxN7QepcrnAg9HI6pAT813+JPf fo8qP/Xu4k9UXue3LgqO3fKke5ve2Tx7cvHKejYcNEP7Qsc9Dt9znbknNs5NmM+98iDY Fg/vbF/2lN/AgLHVmLDvBmKAIscL8af5TJcQKe3K9n61cb2XmG9q/bFHG1+eqnFpQhPp 62Kf6TfzElQAu9HwDaUKgtq4zyVG7bYL5q+0yzXyr9liEbBEVdyhUTdje/+T49xLzKjh JGgx5I29FcU5ec/z2N4A8QaD/stGrmmJZdsJ9q9CcmP9QPEaDZ/n/8Zy4ST4HRrrPg/n EKyg== 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 v25-20020a50d099000000b00461d2ed78acsi12689982edd.378.2022.11.01.14.22.52; Tue, 01 Nov 2022 14:23:18 -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 S230006AbiKAVRV (ORCPT + 99 others); Tue, 1 Nov 2022 17:17:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbiKAVQJ (ORCPT ); Tue, 1 Nov 2022 17:16:09 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39BE01DDE6 for ; Tue, 1 Nov 2022 14:15:33 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybaoWfM8; Tue, 01 Nov 2022 22:15:31 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:31 +0100 X-ME-IP: 86.243.100.34 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 27/30] KVM: x86/mmu: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:15 +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 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?1748330399926435272?= X-GMAIL-MSGID: =?utf-8?q?1748330399926435272?= 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/ --- 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 6f81539061d6..aa45abce7586 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -6641,7 +6642,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);