linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NDS32: perf_event_cpu: fix 2 build errors
@ 2021-09-26  5:58 Randy Dunlap
  2021-09-27 10:06 ` Greentime Hu
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2021-09-26  5:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Nickhu, Greentime Hu, Vincent Chen

../arch/nds32/kernel/perf_event_cpu.c: In function 'unwind_frame_kernel':
../arch/nds32/include/asm/current.h:10:13: error: '$r25' undeclared (first use in this function)
   10 | #define tsk $r25
../arch/nds32/kernel/perf_event_cpu.c:1255:50: note: in expansion of macro 'tsk'
 1255 |                                                 (tsk, &graph, frame->lp, NULL);

../arch/nds32/kernel/perf_event_cpu.c:1257:27: error: assignment to 'long unsigned int' from 'long unsigned int *' makes integer from pointer without a cast [-Werror=int-conversion]
 1257 |                 frame->sp = ((unsigned long *)frame->sp) + 1;

For $r25, use the register function for current() instead.

Fixes: c8b34461705e ("nds32: Add perf call-graph support.")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Nickhu <nickhu@andestech.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Vincent Chen <deanbo422@gmail.com>
---
Please check the frame->sp cast/arithmetic.

 arch/nds32/kernel/perf_event_cpu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-next-20210917.orig/arch/nds32/kernel/perf_event_cpu.c
+++ linux-next-20210917/arch/nds32/kernel/perf_event_cpu.c
@@ -1252,9 +1252,9 @@ static int unwind_frame_kernel(struct st
 		 */
 		if (__kernel_text_address(frame->lp))
 			frame->lp = ftrace_graph_ret_addr
-						(tsk, &graph, frame->lp, NULL);
+					(current, &graph, frame->lp, NULL);
 
-		frame->sp = ((unsigned long *)frame->sp) + 1;
+		frame->sp = (unsigned long)(((unsigned long *)frame->sp)) + 1;
 
 		return 0;
 	} else {

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

* Re: [PATCH] NDS32: perf_event_cpu: fix 2 build errors
  2021-09-26  5:58 [PATCH] NDS32: perf_event_cpu: fix 2 build errors Randy Dunlap
@ 2021-09-27 10:06 ` Greentime Hu
  2022-02-17 18:58   ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Greentime Hu @ 2021-09-27 10:06 UTC (permalink / raw)
  To: Randy Dunlap, Alan Kao
  Cc: Linux Kernel Mailing List, Nickhu, Vincent Chen, kclin

Randy Dunlap <rdunlap@infradead.org> 於 2021年9月26日 週日 下午1:58寫道:
>
> ../arch/nds32/kernel/perf_event_cpu.c: In function 'unwind_frame_kernel':
> ../arch/nds32/include/asm/current.h:10:13: error: '$r25' undeclared (first use in this function)
>    10 | #define tsk $r25
> ../arch/nds32/kernel/perf_event_cpu.c:1255:50: note: in expansion of macro 'tsk'
>  1255 |                                                 (tsk, &graph, frame->lp, NULL);
>
> ../arch/nds32/kernel/perf_event_cpu.c:1257:27: error: assignment to 'long unsigned int' from 'long unsigned int *' makes integer from pointer without a cast [-Werror=int-conversion]
>  1257 |                 frame->sp = ((unsigned long *)frame->sp) + 1;
>
> For $r25, use the register function for current() instead.
>
> Fixes: c8b34461705e ("nds32: Add perf call-graph support.")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Nickhu <nickhu@andestech.com>
> Cc: Greentime Hu <green.hu@gmail.com>
> Cc: Vincent Chen <deanbo422@gmail.com>
> ---
> Please check the frame->sp cast/arithmetic.
>
>  arch/nds32/kernel/perf_event_cpu.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- linux-next-20210917.orig/arch/nds32/kernel/perf_event_cpu.c
> +++ linux-next-20210917/arch/nds32/kernel/perf_event_cpu.c
> @@ -1252,9 +1252,9 @@ static int unwind_frame_kernel(struct st
>                  */
>                 if (__kernel_text_address(frame->lp))
>                         frame->lp = ftrace_graph_ret_addr
> -                                               (tsk, &graph, frame->lp, NULL);
> +                                       (current, &graph, frame->lp, NULL);
>
> -               frame->sp = ((unsigned long *)frame->sp) + 1;
> +               frame->sp = (unsigned long)(((unsigned long *)frame->sp)) + 1;
>
>                 return 0;
>         } else {

Loop in Alan and KC.

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

* Re: [PATCH] NDS32: perf_event_cpu: fix 2 build errors
  2021-09-27 10:06 ` Greentime Hu
@ 2022-02-17 18:58   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2022-02-17 18:58 UTC (permalink / raw)
  To: Greentime Hu, Alan Kao
  Cc: Linux Kernel Mailing List, Nickhu, Vincent Chen, kclin

Hi--

On 9/27/21 03:06, Greentime Hu wrote:
> Randy Dunlap <rdunlap@infradead.org> 於 2021年9月26日 週日 下午1:58寫道:
>>
>> ../arch/nds32/kernel/perf_event_cpu.c: In function 'unwind_frame_kernel':
>> ../arch/nds32/include/asm/current.h:10:13: error: '$r25' undeclared (first use in this function)
>>    10 | #define tsk $r25
>> ../arch/nds32/kernel/perf_event_cpu.c:1255:50: note: in expansion of macro 'tsk'
>>  1255 |                                                 (tsk, &graph, frame->lp, NULL);
>>
>> ../arch/nds32/kernel/perf_event_cpu.c:1257:27: error: assignment to 'long unsigned int' from 'long unsigned int *' makes integer from pointer without a cast [-Werror=int-conversion]
>>  1257 |                 frame->sp = ((unsigned long *)frame->sp) + 1;
>>
>> For $r25, use the register function for current() instead.
>>
>> Fixes: c8b34461705e ("nds32: Add perf call-graph support.")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Nickhu <nickhu@andestech.com>
>> Cc: Greentime Hu <green.hu@gmail.com>
>> Cc: Vincent Chen <deanbo422@gmail.com>
>> ---
>> Please check the frame->sp cast/arithmetic.
>>
>>  arch/nds32/kernel/perf_event_cpu.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> --- linux-next-20210917.orig/arch/nds32/kernel/perf_event_cpu.c
>> +++ linux-next-20210917/arch/nds32/kernel/perf_event_cpu.c
>> @@ -1252,9 +1252,9 @@ static int unwind_frame_kernel(struct st
>>                  */
>>                 if (__kernel_text_address(frame->lp))
>>                         frame->lp = ftrace_graph_ret_addr
>> -                                               (tsk, &graph, frame->lp, NULL);
>> +                                       (current, &graph, frame->lp, NULL);
>>
>> -               frame->sp = ((unsigned long *)frame->sp) + 1;
>> +               frame->sp = (unsigned long)(((unsigned long *)frame->sp)) + 1;
>>
>>                 return 0;
>>         } else {
> 
> Loop in Alan and KC.

Ping.  Does anybody care?

-- 
~Randy

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

end of thread, other threads:[~2022-02-17 18:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26  5:58 [PATCH] NDS32: perf_event_cpu: fix 2 build errors Randy Dunlap
2021-09-27 10:06 ` Greentime Hu
2022-02-17 18:58   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).