[PATCH 2/2] kcsan: Remove redundant call of kallsyms_lookup_name()

From: Marco Elver
Date: Mon Oct 14 2024 - 10:43:39 EST


From: Ran Xiaokai <ran.xiaokai@xxxxxxxxxx>

There is no need to repeatedly call kallsyms_lookup_name, we can reuse
the return value of this function.

Signed-off-by: Ran Xiaokai <ran.xiaokai@xxxxxxxxxx>
Signed-off-by: Marco Elver <elver@xxxxxxxxxx>
---
kernel/kcsan/debugfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/kcsan/debugfs.c b/kernel/kcsan/debugfs.c
index b14072071889..2af39ba5b70b 100644
--- a/kernel/kcsan/debugfs.c
+++ b/kernel/kcsan/debugfs.c
@@ -179,8 +179,7 @@ static ssize_t insert_report_filterlist(const char *func)
}

/* Note: deduplicating should be done in userspace. */
- report_filterlist.addrs[report_filterlist.used++] =
- kallsyms_lookup_name(func);
+ report_filterlist.addrs[report_filterlist.used++] = addr;
report_filterlist.sorted = false;

raw_spin_unlock_irqrestore(&report_filterlist_lock, flags);
--
2.47.0.rc1.288.g06298d1525-goog