The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] staging: sm750fb: Add const to g_fbmode array
@ 2026-05-09 16:40 Alone
  2026-05-11  7:57 ` Greg Kroah-Hartman
  2026-05-11 15:37 ` kernel test robot
  0 siblings, 2 replies; 11+ messages in thread
From: Alone @ 2026-05-09 16:40 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: linux-fbdev, linux-staging, linux-kernel, Chhabilal Dangal

From: Chhabilal Dangal <yogeshdangal66@gmail.com>

Add const qualifier to g_fbmode array since the array
itself is not modified after initialization.

Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e..19c3da654 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel;
 static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview;
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread
* Re: [PATCH] staging: sm750fb: Add const to g_fbmode array
@ 2026-05-11 10:52 Chhabilal Dangal
  0 siblings, 0 replies; 11+ messages in thread
From: Chhabilal Dangal @ 2026-05-11 10:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
	linux-kernel

Thanks for catching that! I've now properly configured the kernel:

CONFIG_FB_SM750=m
CONFIG_STAGING=y
CONFIG_FB=y

Ran: make oldconfig
Verified configuration with: cat .config | grep CONFIG_FB_SM750

The patch should compile with these settings enabled. The changes are
minimal (adding const to g_fbmode array) and don't require additional
setup beyond proper kernel configuration.

Thanks for the guidance!

Chhabilal Dangal

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH] staging: sm750fb: add const to g_fbmode array
@ 2026-05-06  3:56 Chaitanya Sabnis
  2026-05-06  6:27 ` Ahmet Sezgin Duran
  2026-05-11 20:42 ` kernel test robot
  0 siblings, 2 replies; 11+ messages in thread
From: Chaitanya Sabnis @ 2026-05-06  3:56 UTC (permalink / raw)
  To: sudipm.mukherjee, teddy.wang, gregkh
  Cc: linux-fbdev, linux-staging, linux-kernel, Chaitanya Sabnis

Fix a checkpatch warning by changing the `g_fbmode` array of
pointers to be `static const char * const`. This ensures that both
the strings and the array of pointers are placed in read-only memory,
preventing unintended modifications and improving security.

Signed-off-by: Chaitanya Sabnis <chaitanya.msabnis@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index dec1f6b88a7d..08d4979c6755 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel;
 static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview;
-- 
2.43.0


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

end of thread, other threads:[~2026-05-11 20:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-09 16:40 [PATCH] staging: sm750fb: Add const to g_fbmode array Alone
2026-05-11  7:57 ` Greg Kroah-Hartman
     [not found]   ` <CAF9nfaDEys+8bcnFRVWWoAvyrvPgXmENbASABG+4dBjMinaP5A@mail.gmail.com>
2026-05-11 10:23     ` Greg Kroah-Hartman
2026-05-11 15:37 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-11 10:52 Chhabilal Dangal
2026-05-06  3:56 [PATCH] staging: sm750fb: add " Chaitanya Sabnis
2026-05-06  6:27 ` Ahmet Sezgin Duran
2026-05-06  7:14   ` Chaitanya Sabnis
2026-05-06 10:36     ` Ahmet Sezgin Duran
2026-05-06 10:44       ` Chaitanya Sabnis
2026-05-11 20:42 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox