From patchwork Tue Nov 1 21:14:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3215797wru; Tue, 1 Nov 2022 14:22:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VoTEBphgNsuqWr0vsyAJ7XN+04pnfAr//9De+/r8JfO6ysOkzaiVo5q5hiiI+RjFGsd+F X-Received: by 2002:a17:907:75f1:b0:78a:f935:647d with SMTP id jz17-20020a17090775f100b0078af935647dmr19959128ejc.587.1667337738108; Tue, 01 Nov 2022 14:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337738; cv=none; d=google.com; s=arc-20160816; b=aroqlNpPg1TUbPaUiLsgeF/5DgiozzchuXZD1RcauUHg5mrlUg7zNghW2Z4Axexhj8 cd+emk6rjQmZj99IEeAC/3AyGXVhCWjeCZyutVm01UWEI9hBiiyrhb9zaLV1Dy5+O7LB 3Sbk2tU9dxJ54QegpG9I9IE/caBrKfseupq0+8qecNduFUhgVKayI5TzUfaqJ1mQ11Yu SVUhi8K86wu8u3BPrPxadPrLw8z/vSileRpYigEo22/5h31YGeyX5URjXYoOnZBNsOmo F2KXXtU5egRuNOMgQ0y201WCnHgAyCQDRmDRagDZ9YdSQd4LkY8cnbutCtdOyBpPAzbG slyg== 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=EyDDolwOgNDtKYREnTcHUKk4QoamW4oLebufnZtZurY=; b=fr0HElHHmVLIl6Nc7NgYv/Oy0dyEszsfTbZ5DC44lFjkiSBYXqCQBNhHxPTcJcn4ZQ oXV7LBNLaWMKZW7XJexfZNhmjrv/WIB0DqzpnWM/ojNqDY9rSUy2s5glxm9+qnFUjAHW vcFCDa4jI5faA/2K0yNPsIIxAM1Ggx935sMkeN21tmGPUen1AiDwbIm028rxDPU3H0IP W7u1DCd2xDte4ptVK390FmtzYdCHaZrtGlCtdQzuaLbr/j0mGEk3RqKyhFM/uF8CgMAO MC2uwEPu/xgJv464xmYVitqM1mK1IyntxSs+S7oBnIyeE+YpH97RH1xsJnvHTGFoKEVF iWFA== 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 ho38-20020a1709070ea600b007add0123aacsi9650396ejc.1006.2022.11.01.14.21.53; Tue, 01 Nov 2022 14:22: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 S231191AbiKAVRI (ORCPT + 99 others); Tue, 1 Nov 2022 17:17:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230477AbiKAVQM (ORCPT ); Tue, 1 Nov 2022 17:16:12 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33A101EEC8 for ; Tue, 1 Nov 2022 14:15:34 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybcoWfMO; Tue, 01 Nov 2022 22:15:33 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:33 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Juergen Gross , Boris Ostrovsky , 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 , xen-devel@lists.xenproject.org Subject: [PATCH 28/30] x86/xen: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:16 +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?1748330336031202441?= X-GMAIL-MSGID: =?utf-8?q?1748330336031202441?= 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 Reviewed-by: Boris Ostrovsky --- 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/xen/enlighten_pv.c | 3 ++- arch/x86/xen/setup.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 05170fc19083..9e1ac6a281e4 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -113,7 +114,7 @@ static __read_mostly bool xen_msr_safe = IS_ENABLED(CONFIG_XEN_PV_MSR_SAFE); static int __init parse_xen_msr_safe(char *str) { if (str) - return strtobool(str, &xen_msr_safe); + return kstrtobool(str, &xen_msr_safe); return -EINVAL; } early_param("xen_msr_safe", parse_xen_msr_safe); diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index cfa99e8f054b..0abccdab5bc6 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -85,7 +86,7 @@ static void __init xen_parse_512gb(void) arg = strstr(xen_start_info->cmd_line, "xen_512gb_limit="); if (!arg) val = true; - else if (strtobool(arg + strlen("xen_512gb_limit="), &val)) + else if (kstrtobool(arg + strlen("xen_512gb_limit="), &val)) return; xen_512gb_limit = val;