Skip to content

Commit 183d4f2

Browse files
captain5050acmel
authored andcommitted
perf bench: Fix two numa NDEBUG warnings
BUG_ON is a no-op if NDEBUG is defined, otherwise it is an assert. Compiling with NDEBUG yields: bench/numa.c: In function ‘bind_to_cpu’: bench/numa.c:314:1: error: control reaches end of non-void function [-Werror=return-type] 314 | } | ^ bench/numa.c: In function ‘bind_to_node’: bench/numa.c:367:1: error: control reaches end of non-void function [-Werror=return-type] 367 | } | ^ Add return statements to cover this case. Reviewed-by: Athira Jajeev <[email protected]> Signed-off-by: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jin Yao <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Xing Zhengjun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent c5eb0a6 commit 183d4f2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/perf/bench/numa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ static cpu_set_t *bind_to_cpu(int target_cpu)
311311

312312
/* BUG_ON due to failure in allocation of orig_mask/mask */
313313
BUG_ON(-1);
314+
return NULL;
314315
}
315316

316317
static cpu_set_t *bind_to_node(int target_node)
@@ -364,6 +365,7 @@ static cpu_set_t *bind_to_node(int target_node)
364365

365366
/* BUG_ON due to failure in allocation of orig_mask/mask */
366367
BUG_ON(-1);
368+
return NULL;
367369
}
368370

369371
static void bind_to_cpumask(cpu_set_t *mask)

0 commit comments

Comments
 (0)