Re: [PATCH 1/4] kcsan, debugfs: Remove redundant call of kallsyms_lookup_name()

From: Marco Elver
Date: Tue Oct 01 2024 - 09:59:49 EST


On Wed, 25 Sept 2024 at 16:32, ran xiaokai <ranxiaokai627@xxxxxxx> wrote:
>
> 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>

Reviewed-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 53b21ae30e00..ed483987869e 100644
> --- a/kernel/kcsan/debugfs.c
> +++ b/kernel/kcsan/debugfs.c
> @@ -181,8 +181,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;
>
> out:
> --
> 2.15.2
>
>