summaryrefslogtreecommitdiff
path: root/scripts/kallsyms.c
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-02-02 08:09:20 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2020-02-03 19:54:15 +0300
commitbe9f6133f8770bb9c5f4a3cb3df6d30d7d3f7e5b (patch)
tree925acc21159ade08671a01a90ad7469422b74793 /scripts/kallsyms.c
parent5f2fb52fac15a8a8e10ce020dd532504a8abfc4e (diff)
downloadlinux-be9f6133f8770bb9c5f4a3cb3df6d30d7d3f7e5b.tar.xz
scripts/kallsyms: rename local variables in read_symbol()
I will use 'sym' for the point to struce sym_entry in the next commit. Rename 'sym', 'stype' to 'name', 'type', which are more intuitive. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kallsyms.c')
-rw-r--r--scripts/kallsyms.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 94153732ec00..5c34edd98b3e 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -176,43 +176,43 @@ static void check_symbol_range(const char *sym, unsigned long long addr,
static int read_symbol(FILE *in, struct sym_entry *s)
{
- char sym[500], stype;
+ char name[500], type;
int rc;
- rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, sym);
+ rc = fscanf(in, "%llx %c %499s\n", &s->addr, &type, name);
if (rc != 3) {
- if (rc != EOF && fgets(sym, 500, in) == NULL)
+ if (rc != EOF && fgets(name, 500, in) == NULL)
fprintf(stderr, "Read error or end of file.\n");
return -1;
}
- if (strlen(sym) >= KSYM_NAME_LEN) {
+ if (strlen(name) >= KSYM_NAME_LEN) {
fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n"
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
- sym, strlen(sym), KSYM_NAME_LEN);
+ name, strlen(name), KSYM_NAME_LEN);
return -1;
}
- if (is_ignored_symbol(sym, stype))
+ if (is_ignored_symbol(name, type))
return -1;
/* Ignore most absolute/undefined (?) symbols. */
- if (strcmp(sym, "_text") == 0)
+ if (strcmp(name, "_text") == 0)
_text = s->addr;
- check_symbol_range(sym, s->addr, text_ranges, ARRAY_SIZE(text_ranges));
- check_symbol_range(sym, s->addr, &percpu_range, 1);
+ check_symbol_range(name, s->addr, text_ranges, ARRAY_SIZE(text_ranges));
+ check_symbol_range(name, s->addr, &percpu_range, 1);
/* include the type field in the symbol name, so that it gets
* compressed together */
- s->len = strlen(sym) + 1;
+ s->len = strlen(name) + 1;
s->sym = malloc(s->len + 1);
if (!s->sym) {
fprintf(stderr, "kallsyms failure: "
"unable to allocate required amount of memory\n");
exit(EXIT_FAILURE);
}
- strcpy(sym_name(s), sym);
- s->sym[0] = stype;
+ strcpy(sym_name(s), name);
+ s->sym[0] = type;
s->percpu_absolute = 0;