[PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array

Ignacio Peña posted 3 patches 2 months, 3 weeks ago
[PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array
Posted by Ignacio Peña 2 months, 3 weeks ago
The g_fbmode array should be declared as const pointer to const
string as its contents never change.
---
 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 1d929aca3..d3bce107f 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.39.5 (Apple Git-154)
Re: [PATCH 1/3] staging: sm750fb: Fix const declaration for g_fbmode array
Posted by Dan Carpenter 2 months, 3 weeks ago
On Tue, Jul 15, 2025 at 08:55:51PM -0400, Ignacio Peña wrote:
> The g_fbmode array should be declared as const pointer to const
> string as its contents never change.

Try compiling this code.  The contents do change.

There are a few other issues as well.  Try running checkpatch on your
patch.  Also there is a specific format for v2 patches
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

regards,
dan carpenter