[PATCH v3] staging: sm750fb: Keep g_fbmode array non-const

Subsystems: staging - silicon motion sm750 frame buffer driver, staging subsystem, the rest

STALE126d

2 messages, 2 authors, 2026-05-11 · open the first message on its own page

[PATCH v3] staging: sm750fb: Keep g_fbmode array non-const

From: Chhabilal Dangal <hidden>
Date: 2026-05-11 17:03:32

The g_fbmode array is modified at runtime, so it must remain
non-const. Added clarifying comment.

Signed-off-by: Chhabilal Dangal <redacted>
---
 drivers/staging/sm750fb/sm750.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e82a..a553099f42f3 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,6 +33,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel;
 static int g_nomtrr;
+/* intentionally non-const since array is modified at runtime */
 static const char *g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
-- 
2.54.0

Re: [PATCH v3] staging: sm750fb: Keep g_fbmode array non-const

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2026-05-11 17:27:25

On Mon, May 11, 2026 at 10:47:45PM +0545, Chhabilal Dangal wrote:
quoted hunk
The g_fbmode array is modified at runtime, so it must remain
non-const. Added clarifying comment.

Signed-off-by: Chhabilal Dangal <redacted>
---
 drivers/staging/sm750fb/sm750.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e82a..a553099f42f3 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,6 +33,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel;
 static int g_nomtrr;
+/* intentionally non-const since array is modified at runtime */
No comment is needed, if you change the code, it breaks the build, so
that is very obvious as you would never submit a patch that you did not
build, right?  :)

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help