Message ID | 527F9AFF0430AB45+20250104144708.18438-1-wangyuli@uniontech.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [RESEND] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static | expand |
On Sat, 4 Jan 2025 22:47:08 +0800 WangYuli <wangyuli@uniontech.com> wrote: > Declare ftrace_get_parent_ra_addr() as static to suppress clang > compiler warning that 'no previous prototype'. This function is > not intended to be called from other parts. > > Fix follow error with clang-19: > > arch/mips/kernel/ftrace.c:251:15: error: no previous prototype for function 'ftrace_get_parent_ra_addr' [-Werror,-Wmissing-prototypes] > 251 | unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long > | ^ > arch/mips/kernel/ftrace.c:251:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > 251 | unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long > | ^ > | static > 1 error generated. Looks good to me. Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Thanks, > > Signed-off-by: WangYuli <wangyuli@uniontech.com> > --- > arch/mips/kernel/ftrace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c > index 8c401e42301c..f39e85fd58fa 100644 > --- a/arch/mips/kernel/ftrace.c > +++ b/arch/mips/kernel/ftrace.c > @@ -248,7 +248,7 @@ int ftrace_disable_ftrace_graph_caller(void) > #define S_R_SP (0xafb0 << 16) /* s{d,w} R, offset(sp) */ > #define OFFSET_MASK 0xffff /* stack offset range: 0 ~ PT_SIZE */ > > -unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long > +static unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long > old_parent_ra, unsigned long parent_ra_addr, unsigned long fp) > { > unsigned long sp, ip, tmp; > -- > 2.45.2 >
On Sun, 5 Jan 2025 17:37:47 +0900 Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote: > On Sat, 4 Jan 2025 22:47:08 +0800 > WangYuli <wangyuli@uniontech.com> wrote: > > > Declare ftrace_get_parent_ra_addr() as static to suppress clang > > compiler warning that 'no previous prototype'. This function is > > not intended to be called from other parts. > > > > Fix follow error with clang-19: > > > > arch/mips/kernel/ftrace.c:251:15: error: no previous prototype for function 'ftrace_get_parent_ra_addr' [-Werror,-Wmissing-prototypes] > > 251 | unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long > > | ^ > > arch/mips/kernel/ftrace.c:251:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > > 251 | unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long > > | ^ > > | static > > 1 error generated. > > Looks good to me. > > Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> > Note, this should go through the MIPS tree. -- Steve
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c index 8c401e42301c..f39e85fd58fa 100644 --- a/arch/mips/kernel/ftrace.c +++ b/arch/mips/kernel/ftrace.c @@ -248,7 +248,7 @@ int ftrace_disable_ftrace_graph_caller(void) #define S_R_SP (0xafb0 << 16) /* s{d,w} R, offset(sp) */ #define OFFSET_MASK 0xffff /* stack offset range: 0 ~ PT_SIZE */ -unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long +static unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long old_parent_ra, unsigned long parent_ra_addr, unsigned long fp) { unsigned long sp, ip, tmp;
Declare ftrace_get_parent_ra_addr() as static to suppress clang compiler warning that 'no previous prototype'. This function is not intended to be called from other parts. Fix follow error with clang-19: arch/mips/kernel/ftrace.c:251:15: error: no previous prototype for function 'ftrace_get_parent_ra_addr' [-Werror,-Wmissing-prototypes] 251 | unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long | ^ arch/mips/kernel/ftrace.c:251:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 251 | unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long | ^ | static 1 error generated. Signed-off-by: WangYuli <wangyuli@uniontech.com> --- arch/mips/kernel/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)