Re: [PATCH 4/8] perf test coresight: Dismiss clang warning for memcpy thread

From: Ian Rogers

Date: Thu Sep 25 2025 - 15:39:47 EST


On Thu, Sep 25, 2025 at 3:26 AM Leo Yan <leo.yan@xxxxxxx> wrote:
>
> clang-18.1.3 on Ubuntu 24.04.2 reports warning:
>
> memcpy_thread.c:30:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
> 30 | }
> | ^
>
> Dismiss the warning with returning NULL from the thread function.
>
> Signed-off-by: Leo Yan <leo.yan@xxxxxxx>

lgtm, should this be moved into being a perf test workload as in
tools/perf/tests/workloads/ ?
There doesn't seem to be anything overly arch specific in the test and
being a workload avoids a cc dependency in the test, as well as
meaning we test with our usual compiler flags, etc.

Thanks,
Ian

> ---
> tools/perf/tests/shell/coresight/memcpy_thread/memcpy_thread.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/tests/shell/coresight/memcpy_thread/memcpy_thread.c b/tools/perf/tests/shell/coresight/memcpy_thread/memcpy_thread.c
> index 5f886cd09e6b3a62b5690dade94f1f8cae3279d2..7e879217be30a86431989dbf1f36d2134ef259cc 100644
> --- a/tools/perf/tests/shell/coresight/memcpy_thread/memcpy_thread.c
> +++ b/tools/perf/tests/shell/coresight/memcpy_thread/memcpy_thread.c
> @@ -27,6 +27,8 @@ static void *thrfn(void *arg)
> }
> for (i = 0; i < len; i++)
> memcpy(dst, src, a->size * 1024);
> +
> + return NULL;
> }
>
> static pthread_t new_thr(void *(*fn) (void *arg), void *arg)
>
> --
> 2.34.1
>