[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEbi=3dk0R3HMnqsK1mSm2bewecdHm279f9zEq1pHWLPo9tdAg@mail.gmail.com>
Date: Wed, 23 Oct 2019 13:46:24 +0800
From: Greentime Hu <green.hu@...il.com>
To: Paul Walmsley <paul.walmsley@...ive.com>,
Mao Han <han_mao@...ky.com>, Guo Ren <guoren@...nel.org>,
Greentime Hu <greentime.hu@...ive.com>
Cc: linux-riscv@...ts.infradead.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 5/8] riscv: mark some code and data as file-static
Paul Walmsley <paul.walmsley@...ive.com> 於 2019年10月19日 週六 下午3:58寫道:
>
> Several functions and arrays which are only used in the files in which
> they are declared are missing "static" qualifiers. Warnings for these
> symbols are reported by sparse:
>
> arch/riscv/kernel/stacktrace.c:22:14: warning: symbol 'walk_stackframe' was not declared. Should it be static?
> arch/riscv/kernel/vdso.c:28:18: warning: symbol 'vdso_data' was not declared. Should it be static?
> arch/riscv/mm/init.c:42:6: warning: symbol 'setup_zero_page' was not declared. Should it be static?
> arch/riscv/mm/init.c:152:7: warning: symbol 'fixmap_pte' was not declared. Should it be static?
> arch/riscv/mm/init.c:211:7: warning: symbol 'trampoline_pmd' was not declared. Should it be static?
> arch/riscv/mm/init.c:212:7: warning: symbol 'fixmap_pmd' was not declared. Should it be static?
> arch/riscv/mm/init.c:219:7: warning: symbol 'early_pmd' was not declared. Should it be static?
> arch/riscv/mm/sifive_l2_cache.c:145:12: warning: symbol 'sifive_l2_init' was not declared. Should it be static?
>
> Resolve these warnings by marking them as static.
>
> Signed-off-by: Paul Walmsley <paul.walmsley@...ive.com>
> ---
> arch/riscv/kernel/stacktrace.c | 6 ++++--
> arch/riscv/kernel/vdso.c | 2 +-
> arch/riscv/mm/init.c | 12 +++++++-----
> arch/riscv/mm/sifive_l2_cache.c | 2 +-
> 4 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
> index 0940681d2f68..fd908baed51c 100644
> --- a/arch/riscv/kernel/stacktrace.c
> +++ b/arch/riscv/kernel/stacktrace.c
> @@ -19,8 +19,10 @@ struct stackframe {
> unsigned long ra;
> };
>
> -void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
> - bool (*fn)(unsigned long, void *), void *arg)
> +static void notrace walk_stackframe(struct task_struct *task,
> + struct pt_regs *regs,
> + bool (*fn)(unsigned long, void *),
> + void *arg)
I think walk_stackframe() could not be static because it will be used
in perf_callchain.c.
Powered by blists - more mailing lists