public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static
@ 2025-01-04 14:47 WangYuli
  2025-01-05  8:37 ` Masami Hiramatsu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: WangYuli @ 2025-01-04 14:47 UTC (permalink / raw)
  To: rostedt, mhiramat, mark.rutland, tsbogend
  Cc: linux-kernel, linux-trace-kernel, linux-mips, xzhong86,
	wuzhangjin, srostedt, linux-mips, ralf, jeffbai, zhanjun,
	guanwentao, jiaxun.yang, gregory.clement, philmd, tglx, rppt,
	WangYuli

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(-)

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static
  2025-01-04 14:47 [RESEND PATCH] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static WangYuli
@ 2025-01-05  8:37 ` Masami Hiramatsu
  2025-01-06 20:22   ` Steven Rostedt
  2025-01-10  8:13 ` Philippe Mathieu-Daudé
  2025-01-11 12:02 ` Thomas Bogendoerfer
  2 siblings, 1 reply; 5+ messages in thread
From: Masami Hiramatsu @ 2025-01-05  8:37 UTC (permalink / raw)
  To: WangYuli
  Cc: rostedt, mark.rutland, tsbogend, linux-kernel, linux-trace-kernel,
	linux-mips, xzhong86, wuzhangjin, srostedt, linux-mips, ralf,
	jeffbai, zhanjun, guanwentao, jiaxun.yang, gregory.clement,
	philmd, tglx, rppt

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
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static
  2025-01-05  8:37 ` Masami Hiramatsu
@ 2025-01-06 20:22   ` Steven Rostedt
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2025-01-06 20:22 UTC (permalink / raw)
  To: Masami Hiramatsu (Google)
  Cc: WangYuli, mark.rutland, tsbogend, linux-kernel,
	linux-trace-kernel, linux-mips, xzhong86, wuzhangjin, srostedt,
	linux-mips, ralf, jeffbai, zhanjun, guanwentao, jiaxun.yang,
	gregory.clement, philmd, tglx, rppt

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static
  2025-01-04 14:47 [RESEND PATCH] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static WangYuli
  2025-01-05  8:37 ` Masami Hiramatsu
@ 2025-01-10  8:13 ` Philippe Mathieu-Daudé
  2025-01-11 12:02 ` Thomas Bogendoerfer
  2 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-01-10  8:13 UTC (permalink / raw)
  To: WangYuli, rostedt, mhiramat, mark.rutland, tsbogend
  Cc: linux-kernel, linux-trace-kernel, linux-mips, xzhong86,
	wuzhangjin, srostedt, linux-mips, ralf, jeffbai, zhanjun,
	guanwentao, jiaxun.yang, gregory.clement, tglx, rppt

On 4/1/25 15:47, WangYuli 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.

Since 2009 in commit 29c5d3462f7c ("MIPS: Tracing: Add function
graph tracer support for MIPS") eh :)

> 
> 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(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static
  2025-01-04 14:47 [RESEND PATCH] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static WangYuli
  2025-01-05  8:37 ` Masami Hiramatsu
  2025-01-10  8:13 ` Philippe Mathieu-Daudé
@ 2025-01-11 12:02 ` Thomas Bogendoerfer
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Bogendoerfer @ 2025-01-11 12:02 UTC (permalink / raw)
  To: WangYuli
  Cc: rostedt, mhiramat, mark.rutland, linux-kernel, linux-trace-kernel,
	linux-mips, xzhong86, wuzhangjin, srostedt, linux-mips, ralf,
	jeffbai, zhanjun, guanwentao, jiaxun.yang, gregory.clement,
	philmd, tglx, rppt

On Sat, Jan 04, 2025 at 10:47:08PM +0800, WangYuli 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.
> 
> 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

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-11 12:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-04 14:47 [RESEND PATCH] MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static WangYuli
2025-01-05  8:37 ` Masami Hiramatsu
2025-01-06 20:22   ` Steven Rostedt
2025-01-10  8:13 ` Philippe Mathieu-Daudé
2025-01-11 12:02 ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox