linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] video: fbdev: omapfb: Use kstrtobool() instead of strtobool()
@ 2023-01-14  8:54 Christophe JAILLET
  2023-01-15 20:57 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-01-14  8:54 UTC (permalink / raw)
  To: Helge Deller
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-omap,
	linux-fbdev, dri-devel

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 was already sent as a part of a serie ([1]) that axed all usages
of strtobool().
Most of the patches have been merged in -next.

I synch'ed with latest -next and re-send the remaining ones as individual
patches.

Changes in v2:
  - No change

[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 <linux/kernel.h>
+#include <linux/kstrtox.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/sysfs.h>
@@ -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 <linux/kernel.h>
+#include <linux/kstrtox.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
@@ -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 <linux/err.h>
 #include <linux/sysfs.h>
 #include <linux/kobject.h>
+#include <linux/kstrtox.h>
 #include <linux/platform_device.h>
 
 #include <video/omapfb_dss.h>
@@ -210,7 +211,7 @@ static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf,
 	int r;
 	bool enable;
 
-	r = strtobool(buf, &enable);
+	r = kstrtobool(buf, &enable);
 	if (r)
 		return r;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
index 06dc41aa0354..831b2c2fbdf9 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
@@ -15,6 +15,7 @@
 #include <linux/uaccess.h>
 #include <linux/platform_device.h>
 #include <linux/kernel.h>
+#include <linux/kstrtox.h>
 #include <linux/mm.h>
 #include <linux/omapfb.h>
 
@@ -96,7 +97,7 @@ static ssize_t store_mirror(struct device *dev,
 	int r;
 	struct fb_var_screeninfo new_var;
 
-	r = strtobool(buf, &mirror);
+	r = kstrtobool(buf, &mirror);
 	if (r)
 		return r;
 
-- 
2.34.1


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

* Re: [PATCH v2] video: fbdev: omapfb: Use kstrtobool() instead of strtobool()
  2023-01-14  8:54 [PATCH v2] video: fbdev: omapfb: Use kstrtobool() instead of strtobool() Christophe JAILLET
@ 2023-01-15 20:57 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2023-01-15 20:57 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: linux-kernel, kernel-janitors, linux-omap, linux-fbdev, dri-devel

On 1/14/23 09:54, Christophe JAILLET 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>

applied.

Thanks!
Helge


> ---
> This patch was already sent as a part of a serie ([1]) that axed all usages
> of strtobool().
> Most of the patches have been merged in -next.
>
> I synch'ed with latest -next and re-send the remaining ones as individual
> patches.
>
> Changes in v2:
>    - No change
>
> [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 <linux/kernel.h>
> +#include <linux/kstrtox.h>
>   #include <linux/module.h>
>   #include <linux/platform_device.h>
>   #include <linux/sysfs.h>
> @@ -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 <linux/kernel.h>
> +#include <linux/kstrtox.h>
>   #include <linux/slab.h>
>   #include <linux/module.h>
>   #include <linux/platform_device.h>
> @@ -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 <linux/err.h>
>   #include <linux/sysfs.h>
>   #include <linux/kobject.h>
> +#include <linux/kstrtox.h>
>   #include <linux/platform_device.h>
>
>   #include <video/omapfb_dss.h>
> @@ -210,7 +211,7 @@ static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf,
>   	int r;
>   	bool enable;
>
> -	r = strtobool(buf, &enable);
> +	r = kstrtobool(buf, &enable);
>   	if (r)
>   		return r;
>
> diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
> index 06dc41aa0354..831b2c2fbdf9 100644
> --- a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
> +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
> @@ -15,6 +15,7 @@
>   #include <linux/uaccess.h>
>   #include <linux/platform_device.h>
>   #include <linux/kernel.h>
> +#include <linux/kstrtox.h>
>   #include <linux/mm.h>
>   #include <linux/omapfb.h>
>
> @@ -96,7 +97,7 @@ static ssize_t store_mirror(struct device *dev,
>   	int r;
>   	struct fb_var_screeninfo new_var;
>
> -	r = strtobool(buf, &mirror);
> +	r = kstrtobool(buf, &mirror);
>   	if (r)
>   		return r;
>


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

end of thread, other threads:[~2023-01-15 20:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-14  8:54 [PATCH v2] video: fbdev: omapfb: Use kstrtobool() instead of strtobool() Christophe JAILLET
2023-01-15 20:57 ` Helge Deller

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).