Skip to content

Commit 94f1b20

Browse files
committed
selftests/cgroup: Fix compile error in test_cpu.c
JIRA: https://issues.redhat.com/browse/RHEL-80382 commit 11312c8 Author: Xiu Jianfeng <xiujianfeng@huawei.com> Date: Fri Oct 11 06:11:53 2024 +0000 selftests/cgroup: Fix compile error in test_cpu.c When compiling the cgroup selftests with the following command: make -C tools/testing/selftests/cgroup/ the compiler complains as below: test_cpu.c: In function ‘test_cpucg_nice’: test_cpu.c:284:39: error: incompatible type for argument 2 of ‘hog_cpus_timed’ 284 | hog_cpus_timed(cpucg, param); | ^~~~~ | | | struct cpu_hog_func_param test_cpu.c:132:53: note: expected ‘void *’ but argument is of type ‘struct cpu_hog_func_param’ 132 | static int hog_cpus_timed(const char *cgroup, void *arg) | ~~~~~~^~~ Fix it by passing the address of param to hog_cpus_timed(). Fixes: 2e82c0d ("cgroup/rstat: Selftests for niced CPU statistics") Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Radostin Stoyanov <rstoyano@redhat.com>
1 parent 1b546df commit 94f1b20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/cgroup/test_cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static int test_cpucg_nice(const char *root)
279279

280280
/* Try to keep niced CPU usage as constrained to hog_cpu as possible */
281281
nice(1);
282-
hog_cpus_timed(cpucg, param);
282+
hog_cpus_timed(cpucg, &param);
283283
exit(0);
284284
} else {
285285
waitpid(pid, &status, 0);

0 commit comments

Comments
 (0)