From patchwork Tue Nov 1 21:14:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13886 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3213257wru; Tue, 1 Nov 2022 14:17:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7TNxyIjAKrEu5w218A+QZFdCq2dEdZ9X05Oxyz4cKdWmlLP4p7P946PAXocwXyoxRaHuO5 X-Received: by 2002:a17:907:8a0a:b0:78d:b87d:e68a with SMTP id sc10-20020a1709078a0a00b0078db87de68amr19551563ejc.301.1667337462396; Tue, 01 Nov 2022 14:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337462; cv=none; d=google.com; s=arc-20160816; b=faKUN7CUfasvOMtPfvptHyJl1bVHs2DvdzcWiIScO6huOBcImP3MFsqVKKhtWtdihy vsTcO/SsSV59Loxim4YOHr08Br+OrSbfd8RTxARC1iksbRdL0yw50MjVGDmaIh4uBwmS e8+FRmv3XeCfrAer1C+4AvkDf4dhTIW12xDmIoCvxvAmsoBNGkiN+nYx/Ag+88aMshw/ Z/hYb8Tc/PzK5QGkGX5AMqoJoCt5LWOfK48ngGd7yjMC1TlZzW0kasw6k+LAQX9XNcWP 38a9ZgsKDrCIaO4eYPrc2UnuefbmFYytoIivdP8TberGPZ2MuDPGHEBO9vEMOJKl0ue/ r5Lw== 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=k/nvnbjuHwpnlrbze4dbBp+/fMdDlovpjS9b7UrE33A=; b=ahRRo4EoAxRtCRh7NPP/BO+mCbNTpkTOuCvLz76soaLcnGalsNlC+PW9LTx7xlADKT kMItjTJ3S2l1RRyiRgZpNdxcfcYI1AAkIo1RxYAqewtkCyfOtf3/xIum0orFqjwWS6zx HXaenPKzBlG5LoKM+gPyDnFl4yjNLwxpDFVuuacDuUqzWpKQ2eYqV/VT8XXzbGsB5fho ysXT0Vi0YUu6d8TVes3c8fdTA7KPS3osFpBYMIHqei0hikbqPmjHc7DY7L1W56R71r3p vxttrbY0soFVT84fXmaG2I4mB4u6yq98WMaTBas8t7qN6rx45Y6tA2A4mls3EJLY4BUM 4IZQ== 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 sa14-20020a1709076d0e00b007827639faffsi13665948ejc.760.2022.11.01.14.17.13; Tue, 01 Nov 2022 14:17: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 S230504AbiKAVQU (ORCPT + 99 others); Tue, 1 Nov 2022 17:16:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbiKAVPf (ORCPT ); Tue, 1 Nov 2022 17:15:35 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F31D21F600 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 pyanoKD2rsfCIpybPoWfJx; Tue, 01 Nov 2022 22:15:20 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:20 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH 16/30] cifs: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:04 +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?1748330047264280372?= X-GMAIL-MSGID: =?utf-8?q?1748330047264280372?= 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/ --- fs/cifs/cifs_debug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 90850da390ae..4f1b3a65e74c 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -779,7 +780,7 @@ static ssize_t cifsFYI_proc_write(struct file *file, const char __user *buffer, rc = get_user(c[0], buffer); if (rc) return rc; - if (strtobool(c, &bv) == 0) + if (kstrtobool(c, &bv) == 0) cifsFYI = bv; else if ((c[0] > '1') && (c[0] <= '9')) cifsFYI = (int) (c[0] - '0'); /* see cifs_debug.h for meanings */ @@ -939,7 +940,7 @@ static ssize_t cifs_security_flags_proc_write(struct file *file, if (count < 3) { /* single char or single char followed by null */ - if (strtobool(flags_string, &bv) == 0) { + if (kstrtobool(flags_string, &bv) == 0) { global_secflags = bv ? CIFSSEC_MAX : CIFSSEC_DEF; return count; } else if (!isdigit(flags_string[0])) {