staging: sm750fb: add const to g_fbmode array
Subsystems (2)
PATCH 1/1 staging: sm750fb: add const to g_fbmode array
--- drivers/staging/sm750fb/sm750.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/sm750.c +1 -1
@@ -21,7 +21,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
Quoted 10 lines · Diego Fernando Mancera Gómez
Signed-off-by Diego Fernando Mancera Gómez <[email protected]>--- drivers/staging/sm750fb/sm750.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/sm750fb/sm750.c +0
-0
drivers/staging/sm750fb/sm750.c line 27
Quoted 8 lines
drivers/staging/sm750fb/sm750.c +1
-1@@ -21,7 +21,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 these changes?
Regards,
Ahmet Sezgin Duran
Replying an off-list email:
Quoted 5 lines
To: Ahmet Sezgin Duran Subject: Re: [PATCH] staging: sm750fb: add const to
g_fbmodearrayHi Ahmet,
Quoted 33 lines
Yes, I have verified the changes. I compiled the module using make M=drivers/staging/sm750fb/ and it compiled successfully without any errors or warnings.
Regards, Diego Fernando Mancera Gómez
Quoted 25 lines · Ahmet Sezgin Duran
Quoted 10 lines · Diego Fernando Mancera Gómez
Signed-off-by Diego Fernando Mancera Gómez <[email protected]>--- drivers/staging/sm750fb/sm750.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/sm750fb/sm750.c +0
-0drivers/staging/sm750fb/sm750.c line 27
Quoted 8 lines
drivers/staging/sm750fb/sm750.c +1
-1@@ -21,7 +21,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 these changes?
Regards,
Ahmet Sezgin Duran
Please reply emails using Reply All and avoid top posting.
Quoted 3 lines
Yes, I have verified the changes. I compiled the module using make M=drivers/staging/sm750fb/ and it compiled successfully without any errors or warnings.
Can you make sure that you had enabled the related module?
Regards,
Ahmet Sezgin Duran
Quoted 2 lines · Ahmet Sezgin Duran
Can you make sure that you had enabled the related module?
Hi Ahmet,
You caught me. I sincerely apologize.
I forced the compilation by running make drivers/staging/sm750fb/sm750.o and immediately saw the errors:error: assignment of read-only location ‘g_fbmode[index]’
I realize now that adding the second const breaks the driver because g_fbmode is dynamically assigned at runtime inside sm750fb_setup and lynxfb_set_fbinfo. The checkpatch.pl warning was a false positive in this specific context, and I failed to verify the build properly before sending the patch.
Please drop this patch. Thank you very much for the lesson in C semantics, build discipline, and mailing list etiquette. It won't happen again.
Regards,
Diego Fernando Mancera Gómez
Quoted 52 lines · Ahmet Sezgin Duran
Replying an off-list email:
Quoted 5 lines
To: Ahmet Sezgin Duran Subject: Re: [PATCH] staging: sm750fb: add const to
g_fbmodearrayHi Ahmet,
Quoted 33 lines
Yes, I have verified the changes. I compiled the module using make M=drivers/staging/sm750fb/ and it compiled successfully without any errors or warnings.
Regards, Diego Fernando Mancera Gómez
Quoted 25 lines · Ahmet Sezgin Duran
Quoted 10 lines · Diego Fernando Mancera Gómez
Signed-off-by Diego Fernando Mancera Gómez <[email protected]>--- drivers/staging/sm750fb/sm750.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/sm750fb/sm750.c +0
-0drivers/staging/sm750fb/sm750.c line 27
Quoted 8 lines
drivers/staging/sm750fb/sm750.c +1
-1@@ -21,7 +21,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 these changes?
Regards,
Ahmet Sezgin DuranPlease reply emails using
Reply Alland avoid top posting.Quoted 3 lines
Yes, I have verified the changes. I compiled the module using make M=drivers/staging/sm750fb/ and it compiled successfully without any errors or warnings.
Can you make sure that you had enabled the related module?
Regards,
Ahmet Sezgin Duran