[PATCH v2] video: fbdev: omapfb: Use kstrtobool() instead of strtobool()
Helge Deller
deller at gmx.de
Sun Jan 15 20:57:19 UTC 2023
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 at 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;
>
More information about the dri-devel
mailing list