Skip to contentSkip to conversation

staging: sm750fb: make g_fbmode array const

PATCH In review [email protected] 2 participants 3 messages Oct 7 – Oct 12 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: sm750fb: make g_fbmode array const

From: Palak Raval <[email protected]>

Make the g_fbmode array of pointers const since its entries are not modified.

---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/sm750.c +1 -1
index 8b93bfeb217b..a24b21f4936a 100644
@@ -12,7 +12,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel __ro_after_init;
 static int g_nomtrr __ro_after_init;
-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 __ro_after_init;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 15 lines · On 10/7/26 1:10 PM, [email protected] wrote:

From: Palak Raval <[email protected]>

Make the g_fbmode array of pointers const since its entries are not modified.

---
  drivers/staging/sm750fb/sm750.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/sm750.c +0 -0
index 8b93bfeb217b..a24b21f4936a 100644

drivers/staging/sm750fb/sm750.c line 18

Quoted 8 lines
drivers/staging/sm750fb/sm750.c +1 -1
@@ -12,7 +12,7 @@
  static int g_hwcursor = 1;
  static int g_noaccel __ro_after_init;
  static int g_nomtrr __ro_after_init;
-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 __ro_after_init;

Did you compile this patch? While SM750 module is enabled?

Regards,
Ahmet Sezgin Duran

A message that is not in the archive (sent off-list or not yet received): CANNUkNj7WJ0TNZUGAdJh9r7FQRQDvj8DmB9_HDD7sonNDHkRnA@mail.gmail.com

#3 lore raw
Quoted 4 lines · Palak Dixit

Hi Ahmet,

Thanks for the review.

Quoted 8 lines

I enabled CONFIG_FB_SM750 and verified the patch by building the driver with:

    make M=drivers/staging/sm750fb

The build completed successfully and the sm750fb .ko module was generated.

Thanks,
Palak Raval

g_fbmode[] is assigned in lynxfb_set_fbinfo() and sm750fb_setup(), so this can't build. Maybe the .ko was left over from an earlier build? "make drivers/staging/sm750fb/sm750.o" should show the error.

This change has been sent and rejected many times before, see:
https://lore.kernel.org/linux-staging/?q=g_fbmode

Also, it doesn't even apply to Greg's staging-testing branch, make sure to rebase.

Regards,
Ahmet Sezgin Duran