Skip to contentSkip to conversation

staging: sm750fb: fix const pointer array declaration

PATCH In review Jack Lee 2 participants 2 messages Jun 12 – Jun 13

Subsystems (3)
lore
Share & tools
lore

Jack Lee

author
#0 lore raw

PATCH 1/1 staging: sm750fb: fix const pointer array declaration

g_fbmode should be declared as static const char * const to prevent modification of the array pointer itself.

---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/sm750.c +1 -1
index 9f3e3d37e82a..19c3da654a43 100644
@@ -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;
Signature · 1 line
2.54.0
#1 lore raw
Quoted 13 lines · Jack Lee

g_fbmode should be declared as static const char * const to prevent modification of the array pointer itself.

---
  drivers/staging/sm750fb/sm750.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/sm750.c +0 -0
index 9f3e3d37e82a..19c3da654a43 100644

drivers/staging/sm750fb/sm750.c line 39

Quoted 8 lines
drivers/staging/sm750fb/sm750.c +1 -1
@@ -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 this patch while sm750fb driver is enabled?

Regards,
Ahmet Sezgin Duran