From: Xiu Jianfeng <xiujianfeng@huaweicloud.com>
To: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org,
mkoutny@suse.com, shuah@kernel.org, joshua.hahn6@gmail.com
Cc: cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, xiujianfeng@huawei.com
Subject: [PATCH -next] selftests/cgroup: Fix compile error in test_cpu.c
Date: Fri, 11 Oct 2024 06:11:53 +0000 [thread overview]
Message-ID: <20241011061153.107208-1-xiujianfeng@huaweicloud.com> (raw)
From: Xiu Jianfeng <xiujianfeng@huawei.com>
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: 2e82c0d4562a ("cgroup/rstat: Selftests for niced CPU statistics")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
tools/testing/selftests/cgroup/test_cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/cgroup/test_cpu.c b/tools/testing/selftests/cgroup/test_cpu.c
index 201ce14cb422..a2b50af8e9ee 100644
--- a/tools/testing/selftests/cgroup/test_cpu.c
+++ b/tools/testing/selftests/cgroup/test_cpu.c
@@ -281,7 +281,7 @@ static int test_cpucg_nice(const char *root)
/* Try to keep niced CPU usage as constrained to hog_cpu as possible */
nice(1);
- hog_cpus_timed(cpucg, param);
+ hog_cpus_timed(cpucg, ¶m);
exit(0);
} else {
waitpid(pid, &status, 0);
--
2.34.1
next reply other threads:[~2024-10-11 6:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 6:11 Xiu Jianfeng [this message]
2024-10-15 1:06 ` [PATCH -next] selftests/cgroup: Fix compile error in test_cpu.c Tejun Heo
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=20241011061153.107208-1-xiujianfeng@huaweicloud.com \
--to=xiujianfeng@huaweicloud.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=joshua.hahn6@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=mkoutny@suse.com \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
--cc=xiujianfeng@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).