Skip to contentSkip to conversation

scripts/kallsyms: constify long_options

PATCH In review Masahiro Yamada 2 participants 2 messages Jun 5, 2023 – Jun 6, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/kallsyms: constify long_options

getopt_long() does not modify this.

---

 scripts/kallsyms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kallsyms.c +1 -1
index 0d2db41177b2..8e97ac7b38a6 100644
@@ -806,7 +806,7 @@ static void record_relative_base(void)
 int main(int argc, char **argv)
 {
 	while (1) {
-		static struct option long_options[] = {
+		static const struct option long_options[] = {
 			{"all-symbols",     no_argument, &all_symbols,     1},
 			{"absolute-percpu", no_argument, &absolute_percpu, 1},
 			{"base-relative",   no_argument, &base_relative,   1},
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Masahiro Yamada

getopt_long() does not modify this.

---

Quoted 20 lines
 scripts/kallsyms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kallsyms.c +1 -1
index 0d2db41177b2..8e97ac7b38a6 100644
@@ -806,7 +806,7 @@ static void record_relative_base(void)
 int main(int argc, char **argv)
 {
 	while (1) {
-		static struct option long_options[] = {
+		static const struct option long_options[] = {
 			{"all-symbols",     no_argument, &all_symbols,     1},
 			{"absolute-percpu", no_argument, &absolute_percpu, 1},
 			{"base-relative",   no_argument, &base_relative,   1},
Signature · 1 line
2.39.2