[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241202150810.270511329@infradead.org>
Date: Mon, 02 Dec 2024 15:59:49 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: mcgrof@...nel.org
Cc: x86@...nel.org,
hpa@...or.com,
petr.pavlu@...e.com,
samitolvanen@...gle.com,
da.gomez@...sung.com,
masahiroy@...nel.org,
nathan@...nel.org,
nicolas@...sle.eu,
linux-kernel@...r.kernel.org,
linux-modules@...r.kernel.org,
linux-kbuild@...r.kernel.org,
hch@...radead.org,
gregkh@...uxfoundation.org,
"Peter Zijlstra (Intel)" <peterz@...radead.org>
Subject: [PATCH -v2 3/7] module/modpost: Add basename helper
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
scripts/mod/modpost.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1553,6 +1553,16 @@ static void mod_set_crcs(struct module *
free(buf);
}
+static const char *mod_basename(const char *modname)
+{
+ const char *basename = strrchr(modname, '/');
+ if (basename)
+ basename++;
+ else
+ basename = modname;
+ return basename;
+}
+
static void read_symbols(const char *modname)
{
const char *symname;
@@ -1697,11 +1707,7 @@ static void check_exports(struct module
s->crc_valid = exp->crc_valid;
s->crc = exp->crc;
- basename = strrchr(mod->name, '/');
- if (basename)
- basename++;
- else
- basename = mod->name;
+ basename = mod_basename(mod->name);
if (!contains_namespace(&mod->imported_namespaces, exp->namespace)) {
modpost_log(!allow_missing_ns_imports,
Powered by blists - more mailing lists