Skip to contentSkip to conversation

staging: sm750fb: Keep g_fbmode array non-const

PATCH In review Chhabilal Dangal 2 participants 3 messages May 11 – May 12 1 message not in the archive

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

PATCH v3 1/1 staging: sm750fb: Keep g_fbmode array non-const

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

---
 drivers/staging/sm750fb/sm750.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/sm750fb/sm750.c +1 -0
index 9f3e3d37e82a..a553099f42f3 100644
@@ -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;
Signature · 1 line
2.54.0
#1 lore raw
Quoted 13 lines · Chhabilal Dangal

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

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

drivers/staging/sm750fb/sm750.c line 36

Quoted 4 lines
drivers/staging/sm750fb/sm750.c +1 -0
@@ -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

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

#3 lore raw
Quoted 4 lines · Alone

Thanks for the clarification and guidance.

I want to learn the correct workflow. As a student contributor, what checks and testing steps should I always perform before sending a patch?

Please start with not top-posting and sending html email :)

After that, go through the kernelnewbies.org first-patch tutorial, as well as the free Linux Foundation kernel development online class. Between those two, you should have a good basis for working on this correctly.

Also read all of the documentation we have about submitting a patch. People wrote that for a reason, don't ignore it :)

thanks,

greg k-h