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; From patchwork Tue Nov 1 21:13:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13870 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212561wru; Tue, 1 Nov 2022 14:16:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4QscfV+vYWj7inRnuje4Jng3/t9ko6ff/+HZiEXqjoQREWEwSamjkoi1QJLJJtgyh94ZmA X-Received: by 2002:a17:907:a46:b0:782:1c1c:8141 with SMTP id be6-20020a1709070a4600b007821c1c8141mr20691556ejc.549.1667337378303; Tue, 01 Nov 2022 14:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337378; cv=none; d=google.com; s=arc-20160816; b=ySEi6p+qSh2Vx74i2td9t73R95lHKwYCT8RkLjKC45fuk/B/Aw1RIk5mGHGPUQhWP3 kuEWgP+4BFCXleAijdsy+V2TDbjfqg/l6L8029dHoBRODbCTupr0MtC85PplktbB3k3J 1PhPo0Z3MMwfgFysoJNTzpOqJNIpAjhWHkeS/IO5uvvPVo4J4IlLn3LS7ojkTSMd6om2 xUuzYg1EnXHyXz9bPgZur0GitGrtxKzEeHWVvYOwIX88+EL795sjC6Ae2nuGxudcdJcL ZqoX5n1jIRTtVPLPSJLAjM5ulJes+wWOvnpcwsohs9Zb2DwmdB83c3HKcN7zJgJPIsNs LH6Q== 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=jaQ02es4/v4/RS3+F7NHcL5loftvqfPPafdd90I7Alg=; b=aYvRQZFfCgO0TUCqU/AfxGgcTwg4dYvT7DbLwSC719tX7b58rm2cXs27og1G4U9vrF KpXuYYsiYSgwQ9TLdYXZoXu9ggugcyqKH1gqTl5ein3n38nA3rLsHlLmIPmJFdzH974v OUjDXG8CBAD3NUP8GBKrJvfdTSxcNzIgpT5jnWqLDXYZBNs6Iy04pk/aF02i9w49dEkv O3ScW154o/wgm2rlIWS/bdifexSez6zouceEAWW3ec36L58UbIxEc2SFlroGoBXSt8Xq k1iSDD9J5WcHO2qsNJjizcwoOw9RWCNSEsT6rPNM/7MRRfZqD4pJ3yLEwnyGhVugccO9 a2dQ== 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 n24-20020a056402515800b004617f587912si12106310edd.279.2022.11.01.14.15.47; Tue, 01 Nov 2022 14:16: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 S230241AbiKAVPB (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiKAVOw (ORCPT ); Tue, 1 Nov 2022 17:14:52 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B03581DDDD for ; Tue, 1 Nov 2022 14:14:51 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpyauoWfGf; Tue, 01 Nov 2022 22:14:49 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:14:49 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 02/30] wifi: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:50 +0100 Message-Id: <1ff34549af5ad6f7c80d5b9e11872b5499065fc1.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748329958376180854?= X-GMAIL-MSGID: =?utf-8?q?1748329958376180854?= 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/wireless/ath/ath10k/debug.c | 5 +++-- drivers/net/wireless/ath/ath9k/ath9k.h | 1 + drivers/net/wireless/ath/ath9k/tx99.c | 2 +- drivers/net/wireless/marvell/mwifiex/debugfs.c | 2 +- drivers/net/wireless/marvell/mwifiex/main.h | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index c861e66ef6bc..b9aea1510f7b 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "core.h" #include "debug.h" @@ -1975,7 +1976,7 @@ static ssize_t ath10k_write_btcoex(struct file *file, buf[buf_size] = '\0'; - if (strtobool(buf, &val) != 0) + if (kstrtobool(buf, &val) != 0) return -EINVAL; if (!ar->coex_support) @@ -2113,7 +2114,7 @@ static ssize_t ath10k_write_peer_stats(struct file *file, buf[buf_size] = '\0'; - if (strtobool(buf, &val) != 0) + if (kstrtobool(buf, &val) != 0) return -EINVAL; mutex_lock(&ar->conf_mutex); diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 3ccf8cfc6b63..2cc23605c9fc 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/net/wireless/ath/ath9k/tx99.c b/drivers/net/wireless/ath/ath9k/tx99.c index 95544ce05acf..8a996ed9a3be 100644 --- a/drivers/net/wireless/ath/ath9k/tx99.c +++ b/drivers/net/wireless/ath/ath9k/tx99.c @@ -189,7 +189,7 @@ static ssize_t write_file_tx99(struct file *file, const char __user *user_buf, buf[len] = '\0'; - if (strtobool(buf, &start)) + if (kstrtobool(buf, &start)) return -EINVAL; mutex_lock(&sc->mutex); diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c b/drivers/net/wireless/marvell/mwifiex/debugfs.c index bda53cb91f37..52b18f4a774b 100644 --- a/drivers/net/wireless/marvell/mwifiex/debugfs.c +++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c @@ -874,7 +874,7 @@ mwifiex_timeshare_coex_write(struct file *file, const char __user *ubuf, if (copy_from_user(&kbuf, ubuf, min_t(size_t, sizeof(kbuf) - 1, count))) return -EFAULT; - if (strtobool(kbuf, ×hare_coex)) + if (kstrtobool(kbuf, ×hare_coex)) return -EINVAL; ret = mwifiex_send_cmd(priv, HostCmd_CMD_ROBUST_COEX, diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h index 63f861e6b28a..b95886e1413e 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include From patchwork Tue Nov 1 21:13:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13887 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3213287wru; Tue, 1 Nov 2022 14:17:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WVB8sg5tfGtAoCydEFxhzP36aeADWifwddGnKegDu+xqqBTN9Mgy7BMue8xRHVzG0NonE X-Received: by 2002:a63:1404:0:b0:46f:eb26:35e0 with SMTP id u4-20020a631404000000b0046feb2635e0mr5208012pgl.158.1667337465508; Tue, 01 Nov 2022 14:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337465; cv=none; d=google.com; s=arc-20160816; b=fxUpsksef+TJq2sV+o3KrdMZ0rDCo2yD1jOmGfeKIbLN4k8b4MKKf8QW/bx4RzzVRY 7UJdm0qP4mObqPK4cHeRfPYpxAeWYRrZQiBXV7CMzj6nVPosPeDB/9s8b5dfcOiMmwgg G54zunl9rled51wqQ51JaNiOflLXLqq1qbU+AxCj+SUpQx/78Dk3we8K9xmt+ahFFHzz z1YQKtyj+u5bfoQa/fjQfaBz8vjoTIPtVbNsubbAb2CpZrvg9PvQTel9yH/Qd5+SbNat o5zwa3/vAXqBH895x+2PGvnJzwfz+EizeNy4PQbpJu98hxQUTd91yhT7pRuyG7RvMGjg Ckcg== 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=X0zCG4ChcnE+xjQXbuGCj6hSAGf7KPoitvusgKcaNVQ=; b=L/ZK2PVtSf2cCtXfiEiaX2cVgZ3OuPnGSVWrJfFu8hDJSzQ63S4Jj8wVTE2P6n1pvT 0twjZCzrWhZgGcbXI4jfj6F1UAscjwM4wv8Ce/9+wS5B7U2lJnzM9TY9dKq6wPtzPNkU DjPwkBiJMn24S8xs6p676+PgkTKXUvmLnC5GKJ0ovHMG7BccmhU3hkBoTfYwC0ddhchj qnQp7mkqegtDbQsldky+2E8PzjXGK37DNdYqBIooBVLDlYbtd7HzRItDQefev8mrLWPn TgsA08pQj+kWipTZchR3C2W1HoemEbt2RdzqD8kmxBcDRhlYdD/iUpI0k/6VxH13MSeT fo+w== 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 187-20020a6301c4000000b0046f9f4985cfsi11999444pgb.513.2022.11.01.14.17.32; Tue, 01 Nov 2022 14:17:45 -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 S230115AbiKAVPH (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbiKAVO5 (ORCPT ); Tue, 1 Nov 2022 17:14:57 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7823A1DF24 for ; Tue, 1 Nov 2022 14:14:55 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpyazoWfH6; Tue, 01 Nov 2022 22:14:54 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:14:54 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 03/30] irqchip: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:51 +0100 Message-Id: <755c4083122071bb27aa8ed5d98156a07bb63a39.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748330050502786208?= X-GMAIL-MSGID: =?utf-8?q?1748330050502786208?= 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]. This patch has NOT been compile tested. [1]: https://lore.kernel.org/all/cover.1667336095.git.christophe.jaillet@wanadoo.fr/ --- drivers/irqchip/irq-gic-v3.c | 3 ++- drivers/irqchip/irq-gic.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 34d58567b78d..997104d4338e 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -1171,7 +1172,7 @@ static bool gicv3_nolpi; static int __init gicv3_nolpi_cfg(char *buf) { - return strtobool(buf, &gicv3_nolpi); + return kstrtobool(buf, &gicv3_nolpi); } early_param("irqchip.gicv3_nolpi", gicv3_nolpi_cfg); diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 4c7bae0ec8f9..799f86d84b43 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -19,6 +19,7 @@ */ #include #include +#include #include #include #include @@ -1332,7 +1333,7 @@ static bool gicv2_force_probe; static int __init gicv2_force_probe_cfg(char *buf) { - return strtobool(buf, &gicv2_force_probe); + return kstrtobool(buf, &gicv2_force_probe); } early_param("irqchip.gicv2_force_probe", gicv2_force_probe_cfg); From patchwork Tue Nov 1 21:13:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13869 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212482wru; Tue, 1 Nov 2022 14:16:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4zLCviGPdzf9Eb79a4A3fxrVA+bSG5ibyWKETXRmp53tXtdkQZR/Le0mzXybZEuN4Dprkq X-Received: by 2002:a63:485f:0:b0:458:764a:2224 with SMTP id x31-20020a63485f000000b00458764a2224mr18486584pgk.620.1667337370399; Tue, 01 Nov 2022 14:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337370; cv=none; d=google.com; s=arc-20160816; b=HV/gQsL/NqNv2ZLYfmCFz+C9vEvVlmALW2zDEx9VGLSrwJO3z9J9LqS8P3Pf/7HWVl M5WsSamtsmlgYRcRNh5ib5t8nSOCyXL1ee0lHTQrCypyrD9TFHmVe4s/MJyMmoDYa1fr BYKD6v4MuFJXON/Mz3pS5dQCfcPWgjb7J7jT9UeN8jeaBSUmRMONVjmmP8O/8uHW71d2 //ZWorB77OSksbpqcHFqoswWBRMx46MEK49g4+Lb4yESMbP92GZx+/+QzMjvwxME0vEs iBFVcuUvrthHlLCKo2B2Nd/DMzidgAwod7veQVAe8eK7NUD1+jEmFRH9cHZB3wsyxpCi bR5w== 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=jvCUVyfqHzxZbK4LGU9tgwhWxmjAwb884yqmoptPDqg=; b=pO1+wVizO7pYgpB/rks+YbpDbapRIKMMfdR2epjnQ9tUN8Rj8Z4BxKuZb+JnbAYWWz mSppoDYAjTgDhs3cYvSHQFJ8oZ7vhQuJaBvrjnTYPf6Ed//8rSw0F05RoFu1mFkyHWYn sZHfcRl26R8NW+aWo57s4DcePSroV7sapPLHVEtFAZv4DtHgTPpGTgmrp/CLtqxZa8u0 F71p/XqqVp6Zs95rSXzjnirwGvD3f5CsSYLDmUOjuBU3N6U6yaYJ5HTZLMuWzMajScvX 2Rs7dlsUJpesPqbkfyF70dYKghk21yi73zRgnWWSm8DQKsFb6cqTC69LOsoW5JUChl3L tyeQ== 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 c189-20020a6335c6000000b0046ff7bbe583si2524353pga.702.2022.11.01.14.15.56; Tue, 01 Nov 2022 14:16:10 -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 S230288AbiKAVPM (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbiKAVO7 (ORCPT ); Tue, 1 Nov 2022 17:14:59 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD1E51DDFF for ; Tue, 1 Nov 2022 14:14:57 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpyb1oWfHL; Tue, 01 Nov 2022 22:14:56 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:14:56 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: "Martin K. Petersen" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Subject: [PATCH 04/30] scsi: target: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:52 +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?1748329950575567336?= X-GMAIL-MSGID: =?utf-8?q?1748329950575567336?= 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: Chaitanya Kulkarni --- 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/target/target_core_configfs.c | 29 ++++++++++---------- drivers/target/target_core_fabric_configfs.c | 3 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 533524299ed6..b8a5c8d6cfde 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -12,6 +12,7 @@ * ****************************************************************************/ +#include #include #include #include @@ -578,7 +579,7 @@ static ssize_t _name##_store(struct config_item *item, const char *page, \ bool flag; \ int ret; \ \ - ret = strtobool(page, &flag); \ + ret = kstrtobool(page, &flag); \ if (ret < 0) \ return ret; \ da->_name = flag; \ @@ -638,7 +639,7 @@ static ssize_t emulate_model_alias_store(struct config_item *item, return -EINVAL; } - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -660,7 +661,7 @@ static ssize_t emulate_write_cache_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -712,7 +713,7 @@ static ssize_t emulate_tas_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -737,7 +738,7 @@ static ssize_t emulate_tpu_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -767,7 +768,7 @@ static ssize_t emulate_tpws_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -866,7 +867,7 @@ static ssize_t pi_prot_format_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -903,7 +904,7 @@ static ssize_t pi_prot_verify_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -932,7 +933,7 @@ static ssize_t force_pr_aptpl_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; if (da->da_dev->export_count) { @@ -954,7 +955,7 @@ static ssize_t emulate_rest_reord_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -977,7 +978,7 @@ static ssize_t unmap_zeroes_data_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -1126,7 +1127,7 @@ static ssize_t alua_support_store(struct config_item *item, bool flag, oldflag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -1165,7 +1166,7 @@ static ssize_t pgr_support_store(struct config_item *item, bool flag, oldflag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; @@ -1194,7 +1195,7 @@ static ssize_t emulate_rsoc_store(struct config_item *item, bool flag; int ret; - ret = strtobool(page, &flag); + ret = kstrtobool(page, &flag); if (ret < 0) return ret; diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 95a88f6224cd..67b18a67317a 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -11,6 +11,7 @@ * ****************************************************************************/ +#include #include #include #include @@ -829,7 +830,7 @@ static ssize_t target_fabric_tpg_base_enable_store(struct config_item *item, int ret; bool op; - ret = strtobool(page, &op); + ret = kstrtobool(page, &op); if (ret) return ret; From patchwork Tue Nov 1 21:13:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13871 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212673wru; Tue, 1 Nov 2022 14:16:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YC8ITU3+NrZ03/4dCWIlE0ly+xnX++MiugS/WNaxbxY6UMtU6VFO78/frOLrKF6cXQQ44 X-Received: by 2002:a05:6402:1cca:b0:460:7d72:8f2 with SMTP id ds10-20020a0564021cca00b004607d7208f2mr21310133edb.205.1667337390650; Tue, 01 Nov 2022 14:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337390; cv=none; d=google.com; s=arc-20160816; b=L8fmrSQejuym/AfbpVWnWgia3WaziYxfOokGffQdjssGDIQJoSZnxeV+fFviR2rlhj wkG59Eccnq42rm4GrnTlkLhPe8Td4y3+ak8bpItsAUqGc1B+wEI6h2g4C7rvYQ7gYJDK n886KHHtd9K/etiaO+z2StLsqYUipYlusU63EttVgIp/ZwzmmjwvNBvv4jscUzEIMQX6 bdxpBjlXkyl20QMMDDo/swW5GPvW9id95X2z/71wOSKPSdhVQ20qiRW4pEvHujik2DJI ku/PRE7fViU6DP/+S2KNdCivtRmIFhPzd1zogowhyrUtBmMjQ2kvVyGa3S3FJzNjwb3y 8tlA== 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=3xBtJ8pQKFtz9jtaEmbilqS3n6653RcIyv4R6Xmmccg=; b=VfUVZNISNuBiu8Z6vDym7aqrNl/EJ90nQYU4vBtjCIZWqdWXhuDohkJN+mx466thhq R6QQzR+tRNu/V3xAPrSdkiZ+t600jCaBpPYAriTKWclBX+IipYt6CU4mIXt1MQmLrv+/ sp5UrnoKliFGcv2efWel3dNg/CRZydISplWXNDtehtUCaRLndueGeQBINYliwqpwknXF a/yN8PFwd+z4Rk/zEtzoQHC0x8hfjXPcOUqy2k4PO+yP91Bp9yBkaigFKSsO8C55DMEY idpt+6Nd9fJlREc9xB9zyjl1Wzm2VsG75TchRzbZs6RaJPB4wJRfwCL9s3VhjSUDhFhP 94bQ== 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 k11-20020a170906128b00b0078d0f57b0e2si9197808ejb.412.2022.11.01.14.16.06; Tue, 01 Nov 2022 14:16:30 -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 S230302AbiKAVPg (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbiKAVPM (ORCPT ); Tue, 1 Nov 2022 17:15: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 EAB6E1EC77 for ; Tue, 1 Nov 2022 14:15:09 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpyb8oWfHr; Tue, 01 Nov 2022 22:15:03 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:03 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , nvdimm@lists.linux.dev Subject: [PATCH 05/30] nvdimm: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:53 +0100 Message-Id: <5990e1eadd81a25026e6f04fdda96bd43ff23a07.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748329972121279245?= X-GMAIL-MSGID: =?utf-8?q?1748329972121279245?= 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/nvdimm/namespace_devs.c | 3 ++- drivers/nvdimm/pmem.c | 3 ++- drivers/nvdimm/region_devs.c | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index c60ec0b373c5..07177eadc56e 100644 --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c @@ -2,6 +2,7 @@ /* * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. */ +#include #include #include #include @@ -1338,7 +1339,7 @@ static ssize_t force_raw_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { bool force_raw; - int rc = strtobool(buf, &force_raw); + int rc = kstrtobool(buf, &force_raw); if (rc) return rc; diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 3c63dc2cdc81..46475d146f64 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -408,7 +409,7 @@ static ssize_t write_cache_store(struct device *dev, bool write_cache; int rc; - rc = strtobool(buf, &write_cache); + rc = kstrtobool(buf, &write_cache); if (rc) return rc; dax_write_cache(pmem->dax_dev, write_cache); diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index e0875d369762..76e1ae6f830a 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -229,7 +230,7 @@ static ssize_t deep_flush_store(struct device *dev, struct device_attribute *att const char *buf, size_t len) { bool flush; - int rc = strtobool(buf, &flush); + int rc = kstrtobool(buf, &flush); struct nd_region *nd_region = to_nd_region(dev); if (rc) @@ -484,7 +485,7 @@ static ssize_t read_only_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { bool ro; - int rc = strtobool(buf, &ro); + int rc = kstrtobool(buf, &ro); struct nd_region *nd_region = to_nd_region(dev); if (rc) From patchwork Tue Nov 1 21:13:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13876 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212801wru; Tue, 1 Nov 2022 14:16:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM607KB0MnlQLzGGTnimCi4gWL9vgE8k8dAJfw4uWz5HOYkbP83j/G/5hV/NgjYmcReMUkqB X-Received: by 2002:a17:903:11c4:b0:178:634b:1485 with SMTP id q4-20020a17090311c400b00178634b1485mr20669529plh.142.1667337406585; Tue, 01 Nov 2022 14:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337406; cv=none; d=google.com; s=arc-20160816; b=OFdpN9S50gPuplr6mRuyWR6gp5keHvK45vjz+tNZqxNiszH7SacZULaUjk07+2Wk+P THFzucAGr3m9nL8QCPffqfHxOaAEu2+LXBGzRiuv3FS4d+sRzn7PjwRc4AI21ZSl8JTZ i2f6H3faaC7Ky1+h607ZY8zsmYvySbsxaLiB9NM2dLOZMLhy6NV8xJkakCh71FtHTLAQ 4pzEWJQGAJGjNc9iezKn2wPlHK86Ssc4bN5eTh33PMcu3cKSHkoQc17Ie0PpHCezL0bD KuWKaGWqzqbFQersd/6xOboSTmiZ2fexqmXRbiRofMh0fPKmpfmJQvClFagAEUwyVb0g RFnA== 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=S+QOfRZAe+O58P33h28RRd/eVKnUAqLLbI2gyU+b/BM=; b=VfrPYxApak9a4sYnmJ1SobC+tLwXVEKOnWL+pDG+9tHfkzJ4TuAj8K98TDOZoE5YcD u7R152am6ConozJOnQcVPIDMvqss827ZySSJc/Hgh1lTrbpwHoOcYw+pZESLI1r5gTtz S4b7swEsillKOYp9lQOX08rtNy9yXwwZLrZr8lvz4sQl/bYViZTVbBva0LyNyxw4Lv54 frvVZ59GsOYW+q0xSI8G5/QFT/LckPgnr44IN8KZGeoF/Pp1Mq8w9Zox71OpBNny94ei 7fCOEGHkmHH7rg0BmBUUd8IJlchwZMlcHzIJveM6lap59OwzDfyOtCMY2cWrOsRrQ4OB Ly3g== 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 g70-20020a636b49000000b0043941e5532dsi12940631pgc.391.2022.11.01.14.16.31; Tue, 01 Nov 2022 14:16:46 -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 S230420AbiKAVPw (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230301AbiKAVP1 (ORCPT ); Tue, 1 Nov 2022 17:15:27 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 428A21DDF7 for ; Tue, 1 Nov 2022 14:15:11 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybFoWfIh; Tue, 01 Nov 2022 22:15:10 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:10 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-nvme@lists.infradead.org Subject: [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:54 +0100 Message-Id: <2e8d7f2f3cb754982f5fe99f2e13cf72db9d6dba.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748329988458554687?= X-GMAIL-MSGID: =?utf-8?q?1748329988458554687?= 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: Chaitanya Kulkarni --- 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/nvme/host/pci.c | 3 ++- drivers/nvme/target/configfs.c | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 5f1d71ac0086..7c83dfd1bca6 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -2186,7 +2187,7 @@ static ssize_t hmb_store(struct device *dev, struct device_attribute *attr, bool new; int ret; - if (strtobool(buf, &new) < 0) + if (kstrtobool(buf, &new) < 0) return -EINVAL; if (new == ndev->hmb) diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index 9443ee1d4ae3..3eb8bdd4d464 100644 --- a/drivers/nvme/target/configfs.c +++ b/drivers/nvme/target/configfs.c @@ -4,6 +4,7 @@ * Copyright (c) 2015-2016 HGST, a Western Digital Company. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -267,7 +268,7 @@ static ssize_t nvmet_param_pi_enable_store(struct config_item *item, struct nvmet_port *port = to_nvmet_port(item); bool val; - if (strtobool(page, &val)) + if (kstrtobool(page, &val)) return -EINVAL; if (nvmet_is_port_enabled(port, __func__)) @@ -532,7 +533,7 @@ static ssize_t nvmet_ns_enable_store(struct config_item *item, bool enable; int ret = 0; - if (strtobool(page, &enable)) + if (kstrtobool(page, &enable)) return -EINVAL; if (enable) @@ -556,7 +557,7 @@ static ssize_t nvmet_ns_buffered_io_store(struct config_item *item, struct nvmet_ns *ns = to_nvmet_ns(item); bool val; - if (strtobool(page, &val)) + if (kstrtobool(page, &val)) return -EINVAL; mutex_lock(&ns->subsys->lock); @@ -579,7 +580,7 @@ static ssize_t nvmet_ns_revalidate_size_store(struct config_item *item, struct nvmet_ns *ns = to_nvmet_ns(item); bool val; - if (strtobool(page, &val)) + if (kstrtobool(page, &val)) return -EINVAL; if (!val) @@ -728,7 +729,7 @@ static ssize_t nvmet_passthru_enable_store(struct config_item *item, bool enable; int ret = 0; - if (strtobool(page, &enable)) + if (kstrtobool(page, &enable)) return -EINVAL; if (enable) @@ -995,7 +996,7 @@ static ssize_t nvmet_subsys_attr_allow_any_host_store(struct config_item *item, bool allow_any_host; int ret = 0; - if (strtobool(page, &allow_any_host)) + if (kstrtobool(page, &allow_any_host)) return -EINVAL; down_write(&nvmet_config_sem); @@ -1272,7 +1273,7 @@ static ssize_t nvmet_subsys_attr_pi_enable_store(struct config_item *item, struct nvmet_subsys *subsys = to_subsys(item); bool pi_enable; - if (strtobool(page, &pi_enable)) + if (kstrtobool(page, &pi_enable)) return -EINVAL; subsys->pi_support = pi_enable; @@ -1392,7 +1393,7 @@ static ssize_t nvmet_referral_enable_store(struct config_item *item, struct nvmet_port *port = to_nvmet_port(item); bool enable; - if (strtobool(page, &enable)) + if (kstrtobool(page, &enable)) goto inval; if (enable) From patchwork Tue Nov 1 21:13:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13874 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212757wru; Tue, 1 Nov 2022 14:16:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41JRJY/86E+z8lHZMRgP6HlXgSYGIh1V24QElSmJ7/c5PkKEH8rQI5yhC1mnrXf7NSYHL/ X-Received: by 2002:a17:906:4fcd:b0:78d:8059:17c with SMTP id i13-20020a1709064fcd00b0078d8059017cmr20240558ejw.423.1667337401652; Tue, 01 Nov 2022 14:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337401; cv=none; d=google.com; s=arc-20160816; b=BmBKLcKzkUcCyRULFjmMBDcnBR7tdMavKJSjJtXjy9VrXD29LEN8uDHBR08SfJWfWA Pq4NooySS0pp2qctfgeesjYXtTPO0/3n06rY5hQAxeaD2jtOsiopx/W0NQfCrOzhJUdi OEW9tW/W5guIj6KdMw8JN+26nwNepCLXOPjERbKrlfKCzVF0H+bx90J0glVsA2yt6hWH 3svLpeddV2/6mYV6+BbIf/gmtCZq3HTx+QSAogiA0F3qV4e1NyOC18C1gkqdKSon4or0 3ogDOtvU6JKsH4ycGsoQvYDDXBMPspNh9q/0/y0nK1UkZUpnSmixInI/pOWr8zAzTgCE /suA== 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=6FehCWP5GZsnbOm9N2W5sNe+xKUQ+z65ctTHstmqzjc=; b=KIWpEGt12en6Ef37C0NjtlDPQ8VPX3o7xBhno3yjU2ZFyyWUSkuWJnVcpQetiIHfsn drDrr1Dvtkpc15ziJVQAyXIId49rkd2mo6i3RHn5f0FsSzPkpkttDC6U9UA6tH8OiRtE ZvkK3tSh1CJB6JDsQwAuAT1Kbc7b2GlEYQcJOYT/qbhCM/TkHBdvNWuXmdw2/jXvGATc oL3rBIgMeRgKC6DkCEDDVWvYivNfKRMw/2MJWP+3/F/PoRC4X9AU9oOYgG+ZMmYhSDcI htem+MrBrSn9eEdlhUNlMTRHZWV9/1/mxYLglY6xBjzZdIkyPiupRVEtCCTwcfTFXTSd KOSg== 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 b12-20020a1709064d4c00b007897abd2d17si9464666ejv.468.2022.11.01.14.16.17; Tue, 01 Nov 2022 14:16:41 -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 S230395AbiKAVPp (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbiKAVP2 (ORCPT ); Tue, 1 Nov 2022 17:15:28 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A51341DDF2 for ; Tue, 1 Nov 2022 14:15:12 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybHoWfIs; Tue, 01 Nov 2022 22:15:11 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:11 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-usb@vger.kernel.org Subject: [PATCH 07/30] usb: core: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:55 +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?1748329983185964208?= X-GMAIL-MSGID: =?utf-8?q?1748329983185964208?= 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/usb/core/port.c | 3 ++- drivers/usb/core/sysfs.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index 38c1a4f4fdea..015204fc67a1 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -7,6 +7,7 @@ * Author: Lan Tianyu */ +#include #include #include #include @@ -63,7 +64,7 @@ static ssize_t disable_store(struct device *dev, struct device_attribute *attr, bool disabled; int rc; - rc = strtobool(buf, &disabled); + rc = kstrtobool(buf, &disabled); if (rc) return rc; diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 631574718d8a..8217032dfb85 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -505,7 +506,7 @@ static ssize_t usb2_hardware_lpm_store(struct device *dev, if (ret < 0) return -EINTR; - ret = strtobool(buf, &value); + ret = kstrtobool(buf, &value); if (!ret) { udev->usb2_hw_lpm_allowed = value; @@ -975,7 +976,7 @@ static ssize_t interface_authorized_default_store(struct device *dev, int rc = count; bool val; - if (strtobool(buf, &val) != 0) + if (kstrtobool(buf, &val) != 0) return -EINVAL; if (val) @@ -1176,7 +1177,7 @@ static ssize_t interface_authorized_store(struct device *dev, struct usb_interface *intf = to_usb_interface(dev); bool val; - if (strtobool(buf, &val) != 0) + if (kstrtobool(buf, &val) != 0) return -EINVAL; if (val) From patchwork Tue Nov 1 21:13:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13872 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212712wru; Tue, 1 Nov 2022 14:16:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ngHyolNnYqSswNEBEDIg9SytGmAMvw+JjZZG1qP5Svs5Wg8QcE0+FgUPJ2Ge2MSPODZGh X-Received: by 2002:a17:907:3e85:b0:73d:60cc:5d06 with SMTP id hs5-20020a1709073e8500b0073d60cc5d06mr20783432ejc.722.1667337395865; Tue, 01 Nov 2022 14:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337395; cv=none; d=google.com; s=arc-20160816; b=LJF6vXhP5uZZ8dsnnEz/jqRVIOlTqu8o/d0fF/B2HXL8o/rl79U5sFx2Nt035m/1fj PiAEcwpoEk+FFC630+kODEkTd5xGmpGAtgBZzWxaX6oAIWNKlsyLpkZwtyGedn7fR+t/ 48+cEoXZ6nhc3fe6zgnZMf1lPPlubQk/r09ongTBldvRIit50SyFRh4lDiu4gkey42f/ qTsxFvZL+cPttuLYzizf3EJyDptcq37hBp3GEW7wq03mHVKDrbBiG31HUcdD4uCiKpWr 0ba3k0nLde/Hw761pWjOdwLuMIGUQ4G6RGgzNN+myaYSePbFYdo3T/9cTgONmKuhc28K +tIw== 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=0yBUegVM0FtjuSWCVdqCIN3h0641TlpDgfSXn4a99YQ=; b=Mo+/CVfp6Xl9dfFAFhdYDPhqGDfpBxm4T06gBNZ8AEwD4SkKmC91D8cq7BckMoqEgY DSMYxDaK1qJky+nEUKBXnQDnsNZmqDcyMXp8qIIa8jJ8vuv4PzPQGEocsL7/5pEkn8Wy dd4bsNiHYCKzDy1M4xdFJ5J/6jPksHSxJoj343yod8kOwYO63xhDV/iYmI/rxyS6nFP0 FOEmvCyH3PWBPBuQhxPjo17NaJ9KJYwQEYLKuo8lZ3urXpJMrTBbWH/Am/9FCLcg8jxN OlTROVZctS3luVx92W65lWPhjR9kxeA9ffB+0BLPV0R9yvOVJjMwilAPFBItP9q2fe/7 p0uA== 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 a14-20020a1709063a4e00b0073c0169863dsi9718357ejf.465.2022.11.01.14.16.10; Tue, 01 Nov 2022 14:16:35 -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 S230267AbiKAVPl (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230304AbiKAVP2 (ORCPT ); Tue, 1 Nov 2022 17:15:28 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1A841EEC1 for ; Tue, 1 Nov 2022 14:15:13 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybIoWfIz; Tue, 01 Nov 2022 22:15:12 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:12 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-usb@vger.kernel.org Subject: [PATCH 08/30] usb: gadget: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:56 +0100 Message-Id: <09bc980d8432a4b5f7d88388ec0df5b085583139.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748329977463337269?= X-GMAIL-MSGID: =?utf-8?q?1748329977463337269?= 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/usb/gadget/configfs.c | 3 ++- drivers/usb/gadget/function/f_mass_storage.c | 3 ++- drivers/usb/gadget/function/storage_common.c | 9 +++++---- drivers/usb/gadget/function/u_serial.c | 3 ++- drivers/usb/gadget/legacy/serial.c | 3 ++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 3a6b4926193e..96121d1c8df4 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -800,7 +801,7 @@ static ssize_t os_desc_use_store(struct config_item *item, const char *page, bool use; mutex_lock(&gi->lock); - ret = strtobool(page, &use); + ret = kstrtobool(page, &use); if (!ret) { gi->use_os_desc = use; ret = len; diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 3abf7f586e2a..3a30feb47073 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -176,6 +176,7 @@ #include #include #include +#include #include #include #include @@ -3387,7 +3388,7 @@ static ssize_t fsg_opts_stall_store(struct config_item *item, const char *page, return -EBUSY; } - ret = strtobool(page, &stall); + ret = kstrtobool(page, &stall); if (!ret) { opts->common->can_stall = stall; ret = len; diff --git a/drivers/usb/gadget/function/storage_common.c b/drivers/usb/gadget/function/storage_common.c index 208c6a92780a..2a4163b0f6fe 100644 --- a/drivers/usb/gadget/function/storage_common.c +++ b/drivers/usb/gadget/function/storage_common.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "storage_common.h" @@ -396,7 +397,7 @@ ssize_t fsg_store_ro(struct fsg_lun *curlun, struct rw_semaphore *filesem, ssize_t rc; bool ro; - rc = strtobool(buf, &ro); + rc = kstrtobool(buf, &ro); if (rc) return rc; @@ -419,7 +420,7 @@ ssize_t fsg_store_nofua(struct fsg_lun *curlun, const char *buf, size_t count) bool nofua; int ret; - ret = strtobool(buf, &nofua); + ret = kstrtobool(buf, &nofua); if (ret) return ret; @@ -470,7 +471,7 @@ ssize_t fsg_store_cdrom(struct fsg_lun *curlun, struct rw_semaphore *filesem, bool cdrom; int ret; - ret = strtobool(buf, &cdrom); + ret = kstrtobool(buf, &cdrom); if (ret) return ret; @@ -493,7 +494,7 @@ ssize_t fsg_store_removable(struct fsg_lun *curlun, const char *buf, bool removable; int ret; - ret = strtobool(buf, &removable); + ret = kstrtobool(buf, &removable); if (ret) return ret; diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 7538279f9817..840626e064e1 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1070,7 +1071,7 @@ ssize_t gserial_set_console(unsigned char port_num, const char *page, size_t cou bool enable; int ret; - ret = strtobool(page, &enable); + ret = kstrtobool(page, &enable); if (ret) return ret; diff --git a/drivers/usb/gadget/legacy/serial.c b/drivers/usb/gadget/legacy/serial.c index dcd3a6603d90..4974bee6049a 100644 --- a/drivers/usb/gadget/legacy/serial.c +++ b/drivers/usb/gadget/legacy/serial.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -109,7 +110,7 @@ static int enable_set(const char *s, const struct kernel_param *kp) if (!s) /* called for no-arg enable == default */ return 0; - ret = strtobool(s, &do_enable); + ret = kstrtobool(s, &do_enable); if (ret || enable == do_enable) return ret; From patchwork Tue Nov 1 21:13:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212800wru; Tue, 1 Nov 2022 14:16:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NV/RT3OI1aDz23fVBdhaCMxFv8i5Hc+pmtUaHHWUpGdDXsSExV2N/7E7Q77/ym1Iru5jJ X-Received: by 2002:a17:906:5d04:b0:77f:ca9f:33d1 with SMTP id g4-20020a1709065d0400b0077fca9f33d1mr20171086ejt.526.1667337406700; Tue, 01 Nov 2022 14:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337406; cv=none; d=google.com; s=arc-20160816; b=THCzHBNOgKQzTKuPWrMH3QBZyQ2ZH2ynWpPKYJigXQq9QrQWmscF5hxZ3q6a0kyDHX 8QJQOhISoa39AKaDqI0TTpZqtyFCxmmGsYpnuaPmm2jtbshU6G18CABebhPUTepbtdLx byV53Y+wzb8AvQMV9IsL42lPCbUkuZ7oo3K8EwPTq6f2fY5GVeZSQc+HzxwFU3nvUDKF +Wi+r62Ln3qmJRiSkPzMGvtYfzdZK6Xe6FlDPYCTLDZMDCx7Z4pgTGg6bQqsob1G/EZO duYwFD21aw5ereYwsl3RoirCs9uNCsk3vS5p3wcqGuBmM+yVT3u6w4BEWKk40nPybJli iobw== 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=a7um//p4JuBJaAHau0Qz8sm4t+bfwPegIelvJKc6O/M=; b=l/2ywQQZzlxcx35ltqHvvh1ZM8soRMAV5OrIdQysCS3VNbWviIXLbyGDxkaUimcegz RrO74GgIuHB23a2MtSzgeBzhHFKMJvid8WQZIXB4kTjF5ridfZ5n34Ie3I/GSLmbIOoH YYiTz/ez9zR6msUawBxUyACLavD3li99T4Jb+BvLu2lYEvwfaZMm2AigacR/iD4+VSoq 2CT54oAKZUEEZzaNSLjkFunxV2Pulsazux6UgjCtZijAZnMqen9K4GWMCvmfmxxu3A0C z1WmeBrptwLizg+UOEF1+iU6KgB3mVdJxlOap2z3FecjPse5CLuyYLH4ITphzdovI2P2 XTRg== 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 gt7-20020a1709072d8700b0078d27c1c8f4si11846194ejc.696.2022.11.01.14.16.21; Tue, 01 Nov 2022 14:16:46 -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 S230401AbiKAVPs (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbiKAVP3 (ORCPT ); Tue, 1 Nov 2022 17:15:29 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACDD81C42C for ; Tue, 1 Nov 2022 14:15:14 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybJoWfJ5; Tue, 01 Nov 2022 22:15:13 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:13 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: "Rafael J. Wysocki" , Len Brown Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-acpi@vger.kernel.org Subject: [PATCH 09/30] ACPI: sysfs: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:57 +0100 Message-Id: <57396f1eacfacdb589127499f8ff64225a39e110.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748329988519623184?= X-GMAIL-MSGID: =?utf-8?q?1748329988519623184?= 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: Andy Shevchenko --- 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/acpi/sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index cc2fe0618178..2d81c742e4d2 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "internal.h" @@ -992,7 +993,7 @@ static ssize_t force_remove_store(struct kobject *kobj, bool val; int ret; - ret = strtobool(buf, &val); + ret = kstrtobool(buf, &val); if (ret < 0) return ret; From patchwork Tue Nov 1 21:13:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212754wru; Tue, 1 Nov 2022 14:16:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5/Ci4hWCuM9ZuNaAO88S7dvRAvv4yweynrkkyUVx0r6BnFkpIqbmQdZImbsOK2OypfKtQI X-Received: by 2002:a65:4508:0:b0:43c:e3c6:d1c2 with SMTP id n8-20020a654508000000b0043ce3c6d1c2mr18589391pgq.582.1667337401146; Tue, 01 Nov 2022 14:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337401; cv=none; d=google.com; s=arc-20160816; b=d31YtGV2Eitqi2N/lr0zP/Ev4C8TIXEpRrYkRRKf8Ot0789TFSpAuaP8Cj7zHz/LVG k4YsQWgN+4HYSFrp7jXR8UxlwlMH5Gw+MRsuQjZgRxySd8zDNikOecWhU7piaIdQVsKs uwT0AP5ISYnydSnFjOe2sGaSRZWST/SE5f7UtS4ymsSAW1DmOuKZK/uQw5h33ivWbrpb qWT3R0MHdZU851KnuTY9NHACKUYiD/b7C4DsZLLOlzrwU4lDSv7mni9+9I7a/+schYtX 3vUF0SwFdHP3ylg6UTASqmvBZJLt1WZNU/pPeC0nnUzlvHwjaup/XosqkJt0/c90o6Qe 1gQA== 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=iFAdZJTH7F5pq9UD+iSUlBxlkP7azAMdk+4Aw65MjKI=; b=dpHhSGXVoa9lDrwbymp8AqDfGIAhX5P9ZDpTJmRA1ofs5kpkb7JNwIUxWnY73Z8UVY Nqjt7SqKZC8xLTiVxyaiLaMedjzgqIlPnIJibxPyzLksUzHcakHPWk957dZ2mlDlbH+r G51QphxanHMPQB0URG+/sAwb3lxi/mYPd+dJgSy4OHCUGFL3xNop0x9VNBulhgMar/Q/ z+cbBBbI4Jf5ObGSK3+zx8K4j4YSZ+F8tY5H3cFg1jX3ixCIqVaumncFOtEeTarXKlZ5 54nyV5uFWs23aDphw7YZAV2O50n/83+jozfwsqYqt+i4aCuecpnRDWeYD5/ZAyVnVOr6 /goA== 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 q144-20020a632a96000000b00439f012ca7asi12485676pgq.743.2022.11.01.14.16.27; Tue, 01 Nov 2022 14:16:41 -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 S230410AbiKAVPu (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbiKAVPa (ORCPT ); Tue, 1 Nov 2022 17:15:30 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B50941DDF6 for ; Tue, 1 Nov 2022 14:15:15 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybJoWfJD; Tue, 01 Nov 2022 22:15:14 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:14 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Mark Rutland , Marc Zyngier , Daniel Lezcano , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/30] clocksource/drivers/arm_arch_timer: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:58 +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?1748329982856928033?= X-GMAIL-MSGID: =?utf-8?q?1748329982856928033?= 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 Acked-by: Mark Rutland --- 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/clocksource/arm_arch_timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index a7ff77550e17..1af045b231fd 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -97,7 +98,7 @@ static bool evtstrm_enable __ro_after_init = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EV static int __init early_evtstrm_cfg(char *buf) { - return strtobool(buf, &evtstrm_enable); + return kstrtobool(buf, &evtstrm_enable); } early_param("clocksource.arm_arch_timer.evtstrm", early_evtstrm_cfg); From patchwork Tue Nov 1 21:13:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13877 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212836wru; Tue, 1 Nov 2022 14:16:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4O2XofZw2esX3dy8C6QF1LQ1gQYTgq/UwX3tTRkWkU7bB9yMFpj+pESHeVtaM+eYrZY0yO X-Received: by 2002:a17:90a:de13:b0:213:eab9:5e38 with SMTP id m19-20020a17090ade1300b00213eab95e38mr11722134pjv.44.1667337411760; Tue, 01 Nov 2022 14:16:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337411; cv=none; d=google.com; s=arc-20160816; b=EhKGkpThHF365UkBKWHcbVkqi991PPnu0ZXvlLj4O5DoyJ8E0tSH6L/djKW0X73H+z ZZo2N48eH3cFWk5LGqbxyQlw8+9YpFnH4n7CyNUBYaKgqbli4eDXGwOXT4VMuAYvTEKs KVOeXUnt4oAFSRW67UcLD3t+skRWzgSt/g7K8+bLc94tgoeLoH81J7HER7owqGYgCSOX EcWkX4Pbolw/UERydJUps+5lf37s2yPJhq+lRCtcn0009tRJrr7oFltTD0r1ySxJfZ2I hGqeW7BJea0p2QqaP+aHplrKu+6ajWIvuehyeeB3rR2sWkpBvzZKBe8ZnH3cNLEePI8L PFTg== 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=cKPgq5XPQ0c1r0QSZwUMIYc6znIdIn1ZQ5IvQZC+n2Y=; b=sWSH5ZXwWSR8MxFQsNl0+Gf3xHxSRsMw1zgJkjqWIbZCkguC+C/BbzEQaFf39l98TO NKdZXIqURkkjqrXcE4YARqy8i1FGM4LsdjXqoAavAhSvpvewZ+On+VhYveSLzhl0fDWd lcj9o8MTMR1cRAqBusB2GO90P4hDqFDeNdnFpAsXYCUsTshahi9B3weJLHp9+Zn9ey7U C5VRO0x98mUBN16x7EnUjiczw7Cl9ttLVvSjcrB/RWJuWKjGdO84M8Banfz30zuxMDJn 8wzBniYL6gupRGa0ZvDv/ICZAQ7se4oK3oGOV0zqvZpAD2lo9Do75dLC/0dMbw9HDXbc 5LKQ== 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 w200-20020a627bd1000000b0056bc64d158csi12646787pfc.172.2022.11.01.14.16.36; Tue, 01 Nov 2022 14:16:51 -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 S230426AbiKAVPz (ORCPT + 99 others); Tue, 1 Nov 2022 17:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbiKAVPb (ORCPT ); Tue, 1 Nov 2022 17:15:31 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C20541EEFA for ; Tue, 1 Nov 2022 14:15:16 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybKoWfJO; Tue, 01 Nov 2022 22:15:15 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:15 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Johan Hovold , Alex Elder , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , greybus-dev@lists.linaro.org Subject: [PATCH 11/30] greybus: svc: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:13:59 +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?1748329994174509982?= X-GMAIL-MSGID: =?utf-8?q?1748329994174509982?= 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: Alex Elder Reviewed-by: Johan Hovold --- 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/greybus/svc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/greybus/svc.c b/drivers/greybus/svc.c index 56d2b44d6fef..16cced80867a 100644 --- a/drivers/greybus/svc.c +++ b/drivers/greybus/svc.c @@ -7,6 +7,7 @@ */ #include +#include #include #include @@ -83,7 +84,7 @@ static ssize_t watchdog_store(struct device *dev, int retval; bool user_request; - retval = strtobool(buf, &user_request); + retval = kstrtobool(buf, &user_request); if (retval) return retval; From patchwork Tue Nov 1 21:14:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13878 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212844wru; Tue, 1 Nov 2022 14:16:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QtkZ7O7Lxx2FYncTzNTw+7AiKvEAG/QVpevi+fAkFpvcxKzueNXAu8iqw8An9D7gybdAl X-Received: by 2002:a63:ce54:0:b0:46a:e2a9:c7f6 with SMTP id r20-20020a63ce54000000b0046ae2a9c7f6mr18608595pgi.264.1667337412634; Tue, 01 Nov 2022 14:16:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337412; cv=none; d=google.com; s=arc-20160816; b=WI9jFLiem6p6ovgADIAOxUiz0FYHvp2sdOTSMpniRU1klwqVuyCQi4slppS7LnpxsY 6QSsdwlcFb4qBxgafdJCmFbtc9lnecChZmCmS6/YAQtZ8+9BM9UHKUWPDi6UFBxv2HUe RJp7o8uixsHHxY2rt3UkawRWXw4gazTGlWiDF8wLsArxeQEpVTkLPr2ejYzOK0vElhJ0 wxQUZwI/bPws81Hb1Aaa9RU9+KnlKEYY9sjeHNrv+JVy71u8O9dh0Ps9GTdNqBlKQ0Uc J23qr0BkVx9dUE1XqyNeivFUu5VZhO6P0zx0vsrCz+5+S39oWrWv9hDXPNnFW+bdQl6Q KvWA== 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=IP+vwpC5w0lgTjJIfly+G6bIfvDlhjiYE9yhpNMCwlM=; b=RVx3gT5qHACoYXrGOmMfZiBEr9ddjFhamuVpT2jjj+wVRPuvXfd0EMQ+BAECZl2x57 vKvhqc7w0aH06o/nul3loNLcC9nS5InESNFqkofCdCixVcd87Q206+9yE9xBAshe2yxx R4zHSof+vanTsevulhkjYW5GR5w+807rd2RVeWZo8cj82RsupmW17wttFZvQbvVBDRiS +FUc8T9xPJfrI2+4vQlQyczpvqiNsnlXkyRwUhCFGAavWW2gIRADoq4JpTULE+2i/zJ4 n4gmAbHL343/E/2S5kn2fZ9JOJpnNmsnsqA6d/5NaMmgT4XWImpMaA86THbp1YE4E6+L Pxiw== 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 nu7-20020a17090b1b0700b00213a9e1fa86si16763761pjb.73.2022.11.01.14.16.38; Tue, 01 Nov 2022 14:16:52 -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 S230322AbiKAVQF (ORCPT + 99 others); Tue, 1 Nov 2022 17:16:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbiKAVPb (ORCPT ); Tue, 1 Nov 2022 17:15:31 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 850991F2C7 for ; Tue, 1 Nov 2022 14:15:17 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybLoWfJW; Tue, 01 Nov 2022 22:15:15 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:15 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-input@vger.kernel.org Subject: [PATCH 12/30] input: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:00 +0100 Message-Id: <4311e9cb62687449f4175e2b062abcd77aada059.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748329995273966866?= X-GMAIL-MSGID: =?utf-8?q?1748329995273966866?= 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 Acked-by: Dmitry Torokhov --- 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/input/input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index ebb2b7f0f8ff..783961df3626 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include "input-compat.h" @@ -1465,7 +1466,7 @@ static ssize_t inhibited_store(struct device *dev, ssize_t rv; bool inhibited; - if (strtobool(buf, &inhibited)) + if (kstrtobool(buf, &inhibited)) return -EINVAL; if (inhibited) From patchwork Tue Nov 1 21:14:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212906wru; Tue, 1 Nov 2022 14:16:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pi0QdAJC2XEM1hpOr/ibUZsuu4JQD+tTStG5jJUR2CyCEVFMEuSWyDSZ1rtX96MbVqF8b X-Received: by 2002:a17:902:e851:b0:187:2127:ccb with SMTP id t17-20020a170902e85100b0018721270ccbmr12452640plg.99.1667337419191; Tue, 01 Nov 2022 14:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337419; cv=none; d=google.com; s=arc-20160816; b=kiTbN9J0f4+gxWDRw6EjWQNWA+JFkNjOys37zNWjnQ6e4yOtKxPNHcBtooRTnMCYuR 7+aWTh0H6FXaUlCaGHMr91YXNXlUMlwoa1ZTPUy7Df72dPfCK/VAvTTwUmt5j/2Mp52+ b4JIdJ+UtF+g6GYhZd0WJI/eQjzoCqtyFgdBeuuXByy5cpNr1UghBZPuXjdZx/G2J+w1 jXXRM5WphHsCSZEiW1e/B+9UYxqCJtnryLGtmxVF5z20d0cNTJRy4fZcpFDSqtEC+1Fx 1nZn1RreWpLUSlqDId2M96eGTmWWiGH4Veg/OUNsUm0nF0HH0S3f5XryS5nWGyvFDKPz ulsQ== 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=4vKYVAdFkbmag/c8DV8HEihHus8WOUMIp9jbywGlKRs=; b=LSqWUP65iktM3HcRJIsr6sd2ir21xBB12dLbdGIYPAAyEpWBGfiBXhMZuOfApRtpqN umR4+Y1sa/e19WRs9F/ZK826Uh1dLpwMdS151a2dcrEnzWx+K4CQNUICGaSkgzoEdRyo BPGPs5KrWBg1ZG+nV4cvO5d44TO31gZiPEpFgoKpYtFGPAaCZYK4VKiADmxFr9b91y6o /Q0cH3GIqJyo4Ti8c9/UfU/Uhwe6tH34VdWiFxNr5UbkA+wehqbMuU3lr3lM5RSJTEDk u1YhvPfVBpjDhaRVjpDEJITV5aZGg0YX+FMvt+aHQTgzkWm1HNCduS2ioeDCulE3Nf87 ZG0g== 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 g132-20020a636b8a000000b0045a43a568casi14110552pgc.717.2022.11.01.14.16.45; Tue, 01 Nov 2022 14:16:59 -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 S230345AbiKAVQM (ORCPT + 99 others); Tue, 1 Nov 2022 17:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230249AbiKAVPd (ORCPT ); Tue, 1 Nov 2022 17:15:33 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E672A1F2D9 for ; Tue, 1 Nov 2022 14:15:17 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybMoWfJb; Tue, 01 Nov 2022 22:15:16 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:16 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Benson Leung , Guenter Roeck Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , chrome-platform@lists.linux.dev Subject: [PATCH 13/30] platform/chrome: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:01 +0100 Message-Id: <8d66b4688c05a44b592a4d20e2660e9067163276.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748330001662697260?= X-GMAIL-MSGID: =?utf-8?q?1748330001662697260?= 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/platform/chrome/cros_ec_lightbar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec_lightbar.c b/drivers/platform/chrome/cros_ec_lightbar.c index 469dfc7a4a03..58beb2a047b2 100644 --- a/drivers/platform/chrome/cros_ec_lightbar.c +++ b/drivers/platform/chrome/cros_ec_lightbar.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -493,7 +494,7 @@ static ssize_t userspace_control_store(struct device *dev, bool enable; int ret; - ret = strtobool(buf, &enable); + ret = kstrtobool(buf, &enable); if (ret < 0) return ret; From patchwork Tue Nov 1 21:14:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212888wru; Tue, 1 Nov 2022 14:16:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zAdXD8H8K6QajA5qjFT22+aQTOtyScg3NnuKBBR0T6e8vyPJXk8Qa2MR/q3GGpMMeSyr5 X-Received: by 2002:a63:1709:0:b0:46f:f8e0:4b5d with SMTP id x9-20020a631709000000b0046ff8e04b5dmr2999984pgl.368.1667337416681; Tue, 01 Nov 2022 14:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337416; cv=none; d=google.com; s=arc-20160816; b=mNWOvoxtj3C+mtiT2O0o1lIgSGXuPSdC04X3KyHgXe6tCqKX5GAZzoXK5luTfavO0W 7F6IoxluoyhH32mbie7cKlYoGciA6OyIUcSY0O7/vjiDJ2RPBzShU6aPQRMdmbGO8NdH lvho77s1GUH8+VzBK+s1syh2XHGR6fhSrmWh6mEUd6coPZnDzRyAFz6Vc3dQYN4RtMs9 CFU7q4ctmiuO3qGe+kQfChQHiMQTdZ378p04hQmEZlmFj2NV/R2VvXXRhi7eB8RT0Ji5 y32+/Rd+rJvtKASVoUVkYYwKNvj67Vn7a6Z056iXTI3FoaN4QiulKmc/9Ajrn3GFdUsT n3rA== 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=/qQvwcJvCftC4L7VR70xASdSdyEp8r8/2h7Y8zW9BSg=; b=cCcJfyfgt0J/aZTmO/5L7bsLQ+c9VPuvaCC64OOyoGHpUWebLQ1rT3LL9BeXbtcznV 1G8i0UetxeKBiBcn1dQK1jqbDjUI19flwwdpNlWyAv9Ru/HOptqBTmWH5BmRihpUhM25 MLPQsXeAA7SW5JVmbpR9VgMu80jNF9BEHLGBifPNPSUvIQaj33Ol6hxRiS5/yZs4aE4m idUFS3R/tGIlmB2L07nTu1zG0JPAJjKICbmeCB4gSCkENUUHFTE8qBf49W56tj8RFRnp Qk4qMXHnMfQd1iAD9Nco64VBgkfAk9S55VW+vnaQyorHjr0q9Z3N989OKyzLAmxhs2/s MFcw== 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 m11-20020aa78a0b000000b0056cac533dfdsi12050041pfa.261.2022.11.01.14.16.43; Tue, 01 Nov 2022 14:16:56 -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 S230343AbiKAVQJ (ORCPT + 99 others); Tue, 1 Nov 2022 17:16:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230327AbiKAVPd (ORCPT ); Tue, 1 Nov 2022 17:15:33 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 982FA1F2E1 for ; Tue, 1 Nov 2022 14:15:18 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybNoWfJh; Tue, 01 Nov 2022 22:15:17 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:17 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-pm@vger.kernel.org Subject: [PATCH 14/30] powercap: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:02 +0100 Message-Id: <652abbd70fca17977135754901135a6dad5d636c.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748329999027380251?= X-GMAIL-MSGID: =?utf-8?q?1748329999027380251?= 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/powercap/powercap_sys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c index f0654a932b37..1f968353d479 100644 --- a/drivers/powercap/powercap_sys.c +++ b/drivers/powercap/powercap_sys.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -446,7 +447,7 @@ static ssize_t enabled_store(struct device *dev, { bool mode; - if (strtobool(buf, &mode)) + if (kstrtobool(buf, &mode)) return -EINVAL; if (dev->parent) { struct powercap_zone *power_zone = to_powercap_zone(dev); From patchwork Tue Nov 1 21:14:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3213048wru; Tue, 1 Nov 2022 14:17:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7DDAclUsmFC7mPtA5OQGl3QuLpIiSa+Y3QuQi2nfA6pk4ebBCNmSsX8vnQ0RY1FQrVzPp+ X-Received: by 2002:a05:6a00:170a:b0:563:a40a:b5e1 with SMTP id h10-20020a056a00170a00b00563a40ab5e1mr21430429pfc.40.1667337437272; Tue, 01 Nov 2022 14:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337437; cv=none; d=google.com; s=arc-20160816; b=DInvVgfH8NG1BK6atQNrmh/rtzszZBSnofXWDFkqjUUE3sErdetRTZtj7JhgrOk3J4 VGY489jfUHQ+TPd2RsmkKn652wf1LCEK0Rm7Qfkjp+BfxoaTjxHVOHUkP/D3Vlboiotl E8CM70qjGFFtyNJZgswfE4HzLwso8ysS+BxuK7m9D3x7DC7Qj0ohU0k9neOqsnKr0BT3 +UmiJKUKRqgn0mVo0ZUmzg3V6YV8hkANLU+dcZNuOQKcjay01SPMIhQTB0OrZXW+ow6A 973dzuYmJ2OX94eIxdFwAsLCQRDa+o3YuT+3MUulFUdaGggmkMmQqDUyLywItptUPzzs 8AfA== 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=54d3Izzjov4Mk45ZeRZ2rrE0vKTtxWzxTjwzMfKheaY=; b=KUSOYhBUTPBXswxdE+SfFpxjsAoQeT8NN/uuIXkoRRbjwxWKjXnsZX1ZRg4PvEr8SA g9YgVfl07zEscTkDJDT3FO1UllsD+hZHRglyoCCaRofnJ+Wt41QcNSco80fD47HXEu/v H1t3jLFJGXbWBJkIgSdE9jYgYnJ32PcKSgoDmMNzTUxKs7OdhoRs68IgFGo4ZTlllnR9 vR9ZcbK87wYhxS68d1Her8o1TbZRk1/NTaN8/t5WUxCk1y125MB6QQhUQxJU2m0BpaZa 19/kmaNQQAXU15o9qKF1xZeasGhMDf+vn9bX7P58Aj5JNQ1gT/dlvQYHC3DP/BQqrug1 H4vA== 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 lw8-20020a17090b180800b002006ace0cc4si15231486pjb.138.2022.11.01.14.17.04; Tue, 01 Nov 2022 14:17:17 -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 S230495AbiKAVQR (ORCPT + 99 others); Tue, 1 Nov 2022 17:16:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230294AbiKAVPf (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 924C61F2EB for ; Tue, 1 Nov 2022 14:15:20 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybOoWfJm; Tue, 01 Nov 2022 22:15:19 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:19 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Helge Deller Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 15/30] video: fbdev: omapfb: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:03 +0100 Message-Id: <49e4f12b45470c02e4b7c64cc20939667690f948.1667336095.git.christophe.jaillet@wanadoo.fr> 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?1748330020802626186?= X-GMAIL-MSGID: =?utf-8?q?1748330020802626186?= 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/video/fbdev/omap2/omapfb/dss/display-sysfs.c | 7 ++++--- drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c | 7 ++++--- drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c | 3 ++- drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c b/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c index bc5a44c2a144..ae937854403b 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c @@ -10,6 +10,7 @@ #define DSS_SUBSYS_NAME "DISPLAY" #include +#include #include #include #include @@ -36,7 +37,7 @@ static ssize_t display_enabled_store(struct omap_dss_device *dssdev, int r; bool enable; - r = strtobool(buf, &enable); + r = kstrtobool(buf, &enable); if (r) return r; @@ -73,7 +74,7 @@ static ssize_t display_tear_store(struct omap_dss_device *dssdev, if (!dssdev->driver->enable_te || !dssdev->driver->get_te) return -ENOENT; - r = strtobool(buf, &te); + r = kstrtobool(buf, &te); if (r) return r; @@ -183,7 +184,7 @@ static ssize_t display_mirror_store(struct omap_dss_device *dssdev, if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror) return -ENOENT; - r = strtobool(buf, &mirror); + r = kstrtobool(buf, &mirror); if (r) return r; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c b/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c index ba21c4a2633d..1b644be5fe2e 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c @@ -10,6 +10,7 @@ #define DSS_SUBSYS_NAME "MANAGER" #include +#include #include #include #include @@ -246,7 +247,7 @@ static ssize_t manager_trans_key_enabled_store(struct omap_overlay_manager *mgr, bool enable; int r; - r = strtobool(buf, &enable); + r = kstrtobool(buf, &enable); if (r) return r; @@ -290,7 +291,7 @@ static ssize_t manager_alpha_blending_enabled_store( if(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) return -ENODEV; - r = strtobool(buf, &enable); + r = kstrtobool(buf, &enable); if (r) return r; @@ -329,7 +330,7 @@ static ssize_t manager_cpr_enable_store(struct omap_overlay_manager *mgr, if (!dss_has_feature(FEAT_CPR)) return -ENODEV; - r = strtobool(buf, &enable); + r = kstrtobool(buf, &enable); if (r) return r; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c b/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c index 601c0beb6de9..1da4fb1c77b4 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include