Re: [PATCH] staging: sm750fb: add const to g_fbmode array

From: Ahmet Sezgin Duran

Date: Wed May 06 2026 - 02:35:05 EST


On 5/6/26 6:56 AM, Chaitanya Sabnis wrote:
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@xxxxxxxxx>
---
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;

Did you compile these changes?

Regards,
Ahmet Sezgin Duran