[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220501084032.1025918-26-masahiroy@kernel.org>
Date: Sun, 1 May 2022 17:40:31 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-kbuild@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: [PATCH v2 25/26] modpost: simplify the ->is_static initialization
->is_static is set to true at allocation, then to false if the symbol
comes from the dump file.
It is simpler to use !mod->from_dump as the init value.
Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
---
Changes in v2:
- New patch
scripts/mod/modpost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 1f2f53688d40..85fcac84d2d1 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -250,7 +250,7 @@ static struct symbol *alloc_symbol(const char *name)
memset(s, 0, sizeof(*s));
strcpy(s->name, name);
- s->is_static = true;
+
return s;
}
@@ -424,6 +424,7 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod,
s = alloc_symbol(name);
s->module = mod;
+ s->is_static = !mod->from_dump;
s->export = export;
list_add_tail(&s->list, &mod->exported_symbols);
hash_add_symbol(s);
@@ -2518,7 +2519,6 @@ static void read_dump(const char *fname)
mod->from_dump = true;
}
s = sym_add_exported(symname, mod, export_no(export));
- s->is_static = false;
sym_set_crc(s, crc);
sym_update_namespace(symname, namespace);
}
--
2.32.0
Powered by blists - more mailing lists