net: usb: Use kstrtobool() instead of strtobool()
Subsystems (7)
PATCH RESEND 1/1 net: usb: Use kstrtobool() instead of strtobool()
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>).
---
This patch was part of a serie (see [1]), patch 01/30.
This is resent as a stand alone patch so that bots and CI can trigger.
[1]: https://lore.kernel.org/all/[email protected]/
--- drivers/net/usb/cdc_ncm.c | 3 ++- drivers/net/usb/qmi_wwan.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/usb/cdc_ncm.c +2 -1
@@ -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 *attrstruct 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? */
drivers/net/usb/qmi_wwan.c +3 -2
@@ -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, cobool 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;
Signature · 1 line
2.34.1
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Wed, 2 Nov 2022 07:36:23 +0100 you wrote:
strtobool()is the same askstrtobool(). However, the latter is more used within the kernel.In order to remove
strtobool()and slightly simplifykstrtox.h, switch to the other function name.While at it, include the corresponding header file (<
linux/kstrtox.h>).[...]
Here is the summary with links:
- [net-next,RESEND] net: usb: Use kstrtobool() instead of strtobool()
https://git.kernel.org/netdev/net-next/c/c2cce3a6e8eb
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html