From patchwork Wed Nov 2 06:36:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 14044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3442960wru; Tue, 1 Nov 2022 23:48:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5eP5wpjzOsuzUVlcNhe+iPtHoMDZJfjUBRs+1SecCidWo/Y4aqX/r2TdFB3Si6E+Y1/utM X-Received: by 2002:a17:90b:84:b0:213:de0c:1253 with SMTP id bb4-20020a17090b008400b00213de0c1253mr15725669pjb.74.1667371693915; Tue, 01 Nov 2022 23:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667371693; cv=none; d=google.com; s=arc-20160816; b=qNpfLxflpyU67kWqsLhn/N5y3mCd5HP2DdakQTkw4D2TpCyodXucgs7d20LfHM/dNn 2aM2xeUMo1Vo7UC9L1HEqYTDVHpEQLNRMpocNmJrCK3FNIPlLVaWMY/X85cXBvFahxUr uIxnzOlqtggFmeFZlyko8l6fNxoYKr4vPkhyj//64ILk6bIIxGrmyCTOV70nPIwrAfYY vzZ2RHAg27ipi2wIwckRzPBAkCDDzXsXx0zQnbxi/Tpjp7Gx65nwJJ+8n4Rv94fWo/5r Do5C86/4xIktIFsEopdl5zQumgzuYBS6yqfmyD0eJkxA2bueVZ0BPbxsHg3pQfcc91wz wOqg== 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=uHiqAUrOwwck0aYe3VPEcsG8Qsbz/UN5Nqf+6CBuGxA=; b=XXeJmRMjPuotHKeEGhF9yTaJMjUpXT/yMI/4CExoWAr/0UwtQPbgOcq1jrQH8xpIGP Enlc2H9JOXQXGAFZL3ekd7HlBif7OAFYSydKneZve+lipV1OExMDWzpkzXomBZLdMFDw sw091clh1pJN27j4wtOyeoA9uu/76RpLQYoCw0+cuwj8BXVjeD/XQo92ep1XGAl87cfr 3lB36C+h3pTH0qTsXCPFVSq8asscu3uUZZr3SuXa8MgDoo665sDXFVbAiluWoYDFbpwa plTsXinxdEBRab4vvn5C7l17cxkUaLJ+B/kmV0tTKJsFPBfUUhYzsu2j4imtwahENeNW xACg== 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 x24-20020a63db58000000b0046fd05d55e0si8532528pgi.567.2022.11.01.23.47.57; Tue, 01 Nov 2022 23:48:13 -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 S230122AbiKBGgd (ORCPT + 99 others); Wed, 2 Nov 2022 02:36:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbiKBGgb (ORCPT ); Wed, 2 Nov 2022 02:36:31 -0400 Received: from smtp.smtpout.orange.fr (smtp-27.smtpout.orange.fr [80.12.242.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A059A26135 for ; Tue, 1 Nov 2022 23:36:30 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id q7MQoir5CJ83Fq7MQoCnDe; Wed, 02 Nov 2022 07:36:28 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 02 Nov 2022 07:36:28 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Oliver Neukum , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?utf-8?q?Bj=C3=B8rn_Mork?= Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-usb@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next RESEND] net: usb: Use kstrtobool() instead of strtobool() Date: Wed, 2 Nov 2022 07:36:23 +0100 Message-Id: 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=unavailable 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?1748365941222622749?= X-GMAIL-MSGID: =?utf-8?q?1748365941222622749?= 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 part of a serie (see [1]), patch 01/30. This is resent as a stand alone patch so that bots and CI can trigger. [1]: https://lore.kernel.org/all/cover.1667336095.git.christophe.jaillet@wanadoo.fr/ --- drivers/net/usb/cdc_ncm.c | 3 ++- drivers/net/usb/qmi_wwan.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 8d5cbda33f66..6b5f24f28dd1 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -318,7 +319,7 @@ static ssize_t ndp_to_end_store(struct device *d, struct device_attribute *attr struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; bool enable; - if (strtobool(buf, &enable)) + if (kstrtobool(buf, &enable)) return -EINVAL; /* no change? */ diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 26c34a7c21bd..30d733c81ed8 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -343,7 +344,7 @@ static ssize_t raw_ip_store(struct device *d, struct device_attribute *attr, co bool enable; int ret; - if (strtobool(buf, &enable)) + if (kstrtobool(buf, &enable)) return -EINVAL; /* no change? */ @@ -492,7 +493,7 @@ static ssize_t pass_through_store(struct device *d, struct qmi_wwan_state *info; bool enable; - if (strtobool(buf, &enable)) + if (kstrtobool(buf, &enable)) return -EINVAL; info = (void *)&dev->data;