netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/30] net: usb: Use kstrtobool() instead of strtobool()
       [not found] <cover.1667336095.git.christophe.jaillet@wanadoo.fr>
@ 2022-11-01 21:13 ` Christophe JAILLET
  2022-11-02  3:27   ` Jakub Kicinski
  2022-11-01 21:13 ` [PATCH 02/30] wifi: " Christophe JAILLET
  2022-11-01 21:14 ` [PATCH 22/30] Bluetooth: hci_debugfs: " Christophe JAILLET
  2 siblings, 1 reply; 5+ messages in thread
From: Christophe JAILLET @ 2022-11-01 21:13 UTC (permalink / raw)
  To: Oliver Neukum, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Bjørn Mork
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-usb,
	netdev

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 (<linux/kstrtox.h>)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
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 <linux/ctype.h>
 #include <linux/etherdevice.h>
 #include <linux/ethtool.h>
+#include <linux/kstrtox.h>
 #include <linux/workqueue.h>
 #include <linux/mii.h>
 #include <linux/crc32.h>
@@ -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 <linux/ethtool.h>
 #include <linux/etherdevice.h>
 #include <linux/if_arp.h>
+#include <linux/kstrtox.h>
 #include <linux/mii.h>
 #include <linux/rtnetlink.h>
 #include <linux/usb.h>
@@ -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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 02/30] wifi: Use kstrtobool() instead of strtobool()
       [not found] <cover.1667336095.git.christophe.jaillet@wanadoo.fr>
  2022-11-01 21:13 ` [PATCH 01/30] net: usb: Use kstrtobool() instead of strtobool() Christophe JAILLET
@ 2022-11-01 21:13 ` Christophe JAILLET
  2022-11-08  7:39   ` Kalle Valo
  2022-11-01 21:14 ` [PATCH 22/30] Bluetooth: hci_debugfs: " Christophe JAILLET
  2 siblings, 1 reply; 5+ messages in thread
From: Christophe JAILLET @ 2022-11-01 21:13 UTC (permalink / raw)
  To: Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Toke Høiland-Jørgensen, Amitkumar Karwar,
	Ganapathi Bhat, Sharvari Harisangam, Xinming Hu
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, ath10k,
	linux-wireless, netdev

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 (<linux/kstrtox.h>)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
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 <linux/vmalloc.h>
 #include <linux/crc32.h>
 #include <linux/firmware.h>
+#include <linux/kstrtox.h>
 
 #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 <linux/etherdevice.h>
 #include <linux/device.h>
 #include <linux/interrupt.h>
+#include <linux/kstrtox.h>
 #include <linux/leds.h>
 #include <linux/completion.h>
 #include <linux/time.h>
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, &timeshare_coex))
+	if (kstrtobool(kbuf, &timeshare_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 <linux/completion.h>
 #include <linux/kernel.h>
+#include <linux/kstrtox.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/semaphore.h>
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 22/30] Bluetooth: hci_debugfs: Use kstrtobool() instead of strtobool()
       [not found] <cover.1667336095.git.christophe.jaillet@wanadoo.fr>
  2022-11-01 21:13 ` [PATCH 01/30] net: usb: Use kstrtobool() instead of strtobool() Christophe JAILLET
  2022-11-01 21:13 ` [PATCH 02/30] wifi: " Christophe JAILLET
@ 2022-11-01 21:14 ` Christophe JAILLET
  2 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2022-11-01 21:14 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
	linux-bluetooth, netdev

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 (<linux/kstrtox.h>)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
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/
---
 net/bluetooth/hci_debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c
index b7f682922a16..f1ef60ddd4a6 100644
--- a/net/bluetooth/hci_debugfs.c
+++ b/net/bluetooth/hci_debugfs.c
@@ -22,6 +22,7 @@
 */
 
 #include <linux/debugfs.h>
+#include <linux/kstrtox.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -1152,7 +1153,7 @@ static ssize_t force_no_mitm_write(struct file *file,
 		return -EFAULT;
 
 	buf[buf_size] = '\0';
-	if (strtobool(buf, &enable))
+	if (kstrtobool(buf, &enable))
 		return -EINVAL;
 
 	if (enable == hci_dev_test_flag(hdev, HCI_FORCE_NO_MITM))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 01/30] net: usb: Use kstrtobool() instead of strtobool()
  2022-11-01 21:13 ` [PATCH 01/30] net: usb: Use kstrtobool() instead of strtobool() Christophe JAILLET
@ 2022-11-02  3:27   ` Jakub Kicinski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2022-11-02  3:27 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Oliver Neukum, David S. Miller, Eric Dumazet, Paolo Abeni,
	Bjørn Mork, linux-kernel, kernel-janitors, linux-usb, netdev

On Tue,  1 Nov 2022 22:13:49 +0100 Christophe JAILLET wrote:
> 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/

Please repost this patch separately. Patch bots and CIs will not test
partially received series.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 02/30] wifi: Use kstrtobool() instead of strtobool()
  2022-11-01 21:13 ` [PATCH 02/30] wifi: " Christophe JAILLET
@ 2022-11-08  7:39   ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2022-11-08  7:39 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Toke Høiland-Jørgensen, Amitkumar Karwar,
	Ganapathi Bhat, Sharvari Harisangam, Xinming Hu, linux-kernel,
	kernel-janitors, Christophe JAILLET, ath10k, linux-wireless,
	netdev

Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> 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 (<linux/kstrtox.h>)
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Patch applied to wireless-next.git, thanks.

417f173532cc wifi: Use kstrtobool() instead of strtobool()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/1ff34549af5ad6f7c80d5b9e11872b5499065fc1.1667336095.git.christophe.jaillet@wanadoo.fr/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-08  7:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1667336095.git.christophe.jaillet@wanadoo.fr>
2022-11-01 21:13 ` [PATCH 01/30] net: usb: Use kstrtobool() instead of strtobool() Christophe JAILLET
2022-11-02  3:27   ` Jakub Kicinski
2022-11-01 21:13 ` [PATCH 02/30] wifi: " Christophe JAILLET
2022-11-08  7:39   ` Kalle Valo
2022-11-01 21:14 ` [PATCH 22/30] Bluetooth: hci_debugfs: " Christophe JAILLET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).