* [PATCH] fbdev: Use string choices helpers
@ 2025-08-24 15:23 Chelsy Ratnawat
2025-08-24 15:38 ` Helge Deller
0 siblings, 1 reply; 2+ messages in thread
From: Chelsy Ratnawat @ 2025-08-24 15:23 UTC (permalink / raw)
To: simona, deller, adaplas
Cc: raag.jadav, linux-fbdev, dri-devel, Chelsy Ratnawat
Use string_choices.h helpers instead of hard-coded strings.
Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
---
drivers/video/fbdev/core/fbmon.c | 7 ++++---
drivers/video/fbdev/nvidia/nvidia.c | 3 ++-
drivers/video/fbdev/pxafb.c | 3 ++-
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 3b779c27c271..0a65bef01e3c 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -36,6 +36,7 @@
#include <video/of_videomode.h>
#include <video/videomode.h>
#include "../edid.h"
+#include <linux/string_choices.h>
/*
* EDID parser
@@ -320,9 +321,9 @@ static void get_dpms_capabilities(unsigned char flags,
if (flags & DPMS_STANDBY)
specs->dpms |= FB_DPMS_STANDBY;
DPRINTK(" DPMS: Active %s, Suspend %s, Standby %s\n",
- (flags & DPMS_ACTIVE_OFF) ? "yes" : "no",
- (flags & DPMS_SUSPEND) ? "yes" : "no",
- (flags & DPMS_STANDBY) ? "yes" : "no");
+ str_yes_no(flags & DPMS_ACTIVE_OFF),
+ str_yes_no(flags & DPMS_SUSPEND),
+ str_yes_no(flags & DPMS_STANDBY));
}
static void get_chroma(unsigned char *block, struct fb_monspecs *specs)
diff --git a/drivers/video/fbdev/nvidia/nvidia.c b/drivers/video/fbdev/nvidia/nvidia.c
index cfaf9454014d..72b85f475605 100644
--- a/drivers/video/fbdev/nvidia/nvidia.c
+++ b/drivers/video/fbdev/nvidia/nvidia.c
@@ -22,6 +22,7 @@
#include <linux/pci.h>
#include <linux/console.h>
#include <linux/backlight.h>
+#include <linux/string_choices.h>
#ifdef CONFIG_BOOTX_TEXT
#include <asm/btext.h>
#endif
@@ -622,7 +623,7 @@ static int nvidiafb_set_par(struct fb_info *info)
else
par->FPDither = !!(NV_RD32(par->PRAMDAC, 0x083C) & 1);
printk(KERN_INFO PFX "Flat panel dithering %s\n",
- par->FPDither ? "enabled" : "disabled");
+ str_enabled_disabled(par->FPDither));
}
info->fix.visual = (info->var.bits_per_pixel == 8) ?
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index baf87f34cc24..b96a8a96bce8 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -60,6 +60,7 @@
#include <linux/soc/pxa/cpu.h>
#include <video/of_display_timing.h>
#include <video/videomode.h>
+#include <linux/string_choices.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -1419,7 +1420,7 @@ static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on)
if (ret < 0)
pr_warn("Unable to %s LCD supply regulator: %d\n",
- on ? "enable" : "disable", ret);
+ str_enable_disable(on), ret);
else
fbi->lcd_supply_enabled = on;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fbdev: Use string choices helpers
2025-08-24 15:23 [PATCH] fbdev: Use string choices helpers Chelsy Ratnawat
@ 2025-08-24 15:38 ` Helge Deller
0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2025-08-24 15:38 UTC (permalink / raw)
To: Chelsy Ratnawat; +Cc: linux-fbdev, dri-devel
On 8/24/25 17:23, Chelsy Ratnawat wrote:
> Use string_choices.h helpers instead of hard-coded strings.
>
> Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
> ---
> drivers/video/fbdev/core/fbmon.c | 7 ++++---
> drivers/video/fbdev/nvidia/nvidia.c | 3 ++-
> drivers/video/fbdev/pxafb.c | 3 ++-
> 3 files changed, 8 insertions(+), 5 deletions(-)
applied.
Thanks!
Helge
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-24 15:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-24 15:23 [PATCH] fbdev: Use string choices helpers Chelsy Ratnawat
2025-08-24 15:38 ` 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).