From patchwork Tue Nov 1 21:13:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13868 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212416wru; Tue, 1 Nov 2022 14:16:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7EZg34yKLxLK+epG7ls5Pemy9yjaDnS/bkY2XdIOK2Dx/QmFtE++AAbHqQObdJADv8CQ/l X-Received: by 2002:a17:907:6eab:b0:78d:4c16:a687 with SMTP id sh43-20020a1709076eab00b0078d4c16a687mr20185144ejc.392.1667337363528; Tue, 01 Nov 2022 14:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337363; cv=none; d=google.com; s=arc-20160816; b=HHTYpKGYH8ta4sV2WjwxSU0tLOeKbdBURRurH52ErOlghKsMIv4bK3FRpN+qIQicJl EjA7glD7uuCV6Dmcem1wj11yIGMrch2C1qzIjjX+2Wh2ctyx9RRm8VAIU2ZUX1GS9qu7 VWBb52pVNU235Ox9dIiW6hRJKixxdvSiAaT1V9wnQB9TJMiTSay0cz/SAfPvGivIMr3m 9VIsqL1GPBwFZFjVXaZ3cx9fjLc2y/2XdsXh+MigCv3RgjG+Pg/sTOp9VkhmptvJTctB lcA1n2W3qIskXzK7nuMCZm11Ic918i49dkGeIsbenIsxwSI7QUSBkfjb5TUYYYbCu2xX wVSQ== 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=5AWHdidfj9TpI3KXX2k65h4aFQKRrrlPjNGZao5bkVY=; b=j6c8+sFhqaQmrYlu6PpxBMYnuzxoaR8NMQXh0jEWXwGdnuKScFmmodayXJzy3enQh3 NcwRLDaJT8MbluIv3pm166b0ovN0b8OOZb9lo7NC7fOjUCWUXC4drwIAdlFTQ7jmKpoz npNg9O1B0eDXcAw6WOnlbqqEGFsDryjv0iwQ8H0DK5ISc5lV1r7j+b2shqHL+lQUGV0G S/Cgrra2LBNFz6hjhJJ6cTTBJZgLbgMB2vc/6ltbwJoOOoWPCDYu/efKrtfowgxDFxVy 8QR6vH74JhDQK9FqB0oGsoSF3qfNgTY+EoZiJRF1KLwGdWdqh4yw7GOQS0PjVTl4Uvej QqJQ== 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 gn30-20020a1709070d1e00b0078ddffd4660si15442518ejc.651.2022.11.01.14.15.39; Tue, 01 Nov 2022 14:16:03 -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 S229932AbiKAVOu (ORCPT + 99 others); Tue, 1 Nov 2022 17:14:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbiKAVOr (ORCPT ); Tue, 1 Nov 2022 17:14:47 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BAD11D678 for ; Tue, 1 Nov 2022 14:14:46 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpyanoWfG2; Tue, 01 Nov 2022 22:14:44 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:14:44 +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 01/30] net: usb: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:49 +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=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?1748329943546732898?= X-GMAIL-MSGID: =?utf-8?q?1748329943546732898?= 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/ --- 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;