All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greentime Hu <green.hu@gmail.com>
To: Randy Dunlap <rdunlap@infradead.org>, Alan Kao <alankao@andestech.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Nickhu <nickhu@andestech.com>, Vincent Chen <deanbo422@gmail.com>,
	kclin@andestech.com
Subject: Re: [PATCH] NDS32: perf_event_cpu: fix 2 build errors
Date: Mon, 27 Sep 2021 18:06:11 +0800	[thread overview]
Message-ID: <CAEbi=3dmw4nTkU1cF4atXDE6Go-tujqseRKjdX7rmPaid_3D3w@mail.gmail.com> (raw)
In-Reply-To: <20210926055817.24352-1-rdunlap@infradead.org>

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.

  reply	other threads:[~2021-09-27 10:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26  5:58 [PATCH] NDS32: perf_event_cpu: fix 2 build errors Randy Dunlap
2021-09-27 10:06 ` Greentime Hu [this message]
2022-02-17 18:58   ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEbi=3dmw4nTkU1cF4atXDE6Go-tujqseRKjdX7rmPaid_3D3w@mail.gmail.com' \
    --to=green.hu@gmail.com \
    --cc=alankao@andestech.com \
    --cc=deanbo422@gmail.com \
    --cc=kclin@andestech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickhu@andestech.com \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.