Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

objtool: Const string cleanup

Use 'const char *' where applicable.

Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

+10 -10
+1 -1
tools/objtool/arch/loongarch/decode.c
··· 7 7 #include <linux/objtool_types.h> 8 8 #include <arch/elf.h> 9 9 10 - int arch_ftrace_match(char *name) 10 + int arch_ftrace_match(const char *name) 11 11 { 12 12 return !strcmp(name, "_mcount"); 13 13 }
+1 -1
tools/objtool/arch/powerpc/decode.c
··· 9 9 #include <objtool/builtin.h> 10 10 #include <objtool/endianness.h> 11 11 12 - int arch_ftrace_match(char *name) 12 + int arch_ftrace_match(const char *name) 13 13 { 14 14 return !strcmp(name, "_mcount"); 15 15 }
+1 -1
tools/objtool/arch/x86/decode.c
··· 23 23 #include <objtool/builtin.h> 24 24 #include <arch/elf.h> 25 25 26 - int arch_ftrace_match(char *name) 26 + int arch_ftrace_match(const char *name) 27 27 { 28 28 return !strcmp(name, "__fentry__"); 29 29 }
+3 -3
tools/objtool/elf.c
··· 853 853 return sym; 854 854 } 855 855 856 - static int elf_add_string(struct elf *elf, struct section *strtab, char *str); 856 + static int elf_add_string(struct elf *elf, struct section *strtab, const char *str); 857 857 858 858 struct symbol * 859 859 elf_create_prefix_symbol(struct elf *elf, struct symbol *orig, long size) ··· 1086 1086 return NULL; 1087 1087 } 1088 1088 1089 - static int elf_add_string(struct elf *elf, struct section *strtab, char *str) 1089 + static int elf_add_string(struct elf *elf, struct section *strtab, const char *str) 1090 1090 { 1091 1091 Elf_Data *data; 1092 1092 Elf_Scn *s; ··· 1111 1111 return -1; 1112 1112 } 1113 1113 1114 - data->d_buf = str; 1114 + data->d_buf = strdup(str); 1115 1115 data->d_size = strlen(str) + 1; 1116 1116 data->d_align = 1; 1117 1117
+1 -1
tools/objtool/include/objtool/arch.h
··· 71 71 72 72 struct instruction; 73 73 74 - int arch_ftrace_match(char *name); 74 + int arch_ftrace_match(const char *name); 75 75 76 76 void arch_initial_func_cfi_state(struct cfi_init_state *state); 77 77
+3 -3
tools/objtool/include/objtool/elf.h
··· 40 40 struct section *base, *rsec; 41 41 struct symbol *sym; 42 42 Elf_Data *data; 43 - char *name; 43 + const char *name; 44 44 int idx; 45 45 bool _changed, text, rodata, noinstr, init, truncate; 46 46 struct reloc *relocs; ··· 53 53 struct elf_hash_node name_hash; 54 54 GElf_Sym sym; 55 55 struct section *sec; 56 - char *name; 56 + const char *name; 57 57 unsigned int idx, len; 58 58 unsigned long offset; 59 59 unsigned long __subtree_last; ··· 88 88 GElf_Ehdr ehdr; 89 89 int fd; 90 90 bool changed; 91 - char *name; 91 + const char *name; 92 92 unsigned int num_files; 93 93 struct list_head sections; 94 94 unsigned long num_relocs;