Skip to content

Commit 34312de

Browse files
Leo-YanKernel Patches Daemon
authored andcommitted
perf test coresight: Dismiss clang warning for unroll loop thread
clang-18.1.3 on Ubuntu 24.04.2 reports warning: unroll_loop_thread.c:35:25: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths] 35 | : /* in */ [in] "r" (in) | ^ unroll_loop_thread.c:39:1: warning: non-void function does not return a value [-Wreturn-type] 39 | } | ^ Use the modifier "w" for 32-bit register access and return NULL at the end of thread function. Signed-off-by: Leo Yan <[email protected]>
1 parent 88922b1 commit 34312de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/perf/tests/shell/coresight/unroll_loop_thread/unroll_loop_thread.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static void *thrfn(void *arg)
2020
for (i = 0; i < 10000; i++) {
2121
asm volatile (
2222
// force an unroll of thia add instruction so we can test long runs of code
23-
#define SNIP1 "add %[in], %[in], #1\n"
23+
#define SNIP1 "add %w[in], %w[in], #1\n"
2424
// 10
2525
#define SNIP2 SNIP1 SNIP1 SNIP1 SNIP1 SNIP1 SNIP1 SNIP1 SNIP1 SNIP1 SNIP1
2626
// 100
@@ -36,6 +36,8 @@ static void *thrfn(void *arg)
3636
: /* clobber */
3737
);
3838
}
39+
40+
return NULL;
3941
}
4042

4143
static pthread_t new_thr(void *(*fn) (void *arg), void *arg)

0 commit comments

Comments
 (0)