diff mbox series

tst_cgroup: Fix typo

Message ID 1657277348-2169-1-git-send-email-xuyang2018.jy@fujitsu.com
State Accepted
Headers show
Series tst_cgroup: Fix typo | expand

Commit Message

Yang Xu July 8, 2022, 10:49 a.m. UTC
We only have needs_cgroup_ctrls instead of needs_cgroup_controllers in
tst_test structure. So fix it.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
I found it when I plan to write a cgroup regression test to ltp.
 doc/c-test-api.txt   | 6 +++---
 include/tst_cgroup.h | 2 +-
 lib/tst_test.c       | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Li Wang July 11, 2022, 5:38 a.m. UTC | #1
Pushed, thanks!
diff mbox series

Patch

diff --git a/doc/c-test-api.txt b/doc/c-test-api.txt
index c138b7027..9ecf28630 100644
--- a/doc/c-test-api.txt
+++ b/doc/c-test-api.txt
@@ -2144,13 +2144,13 @@  struct tst_test test = {
 	.setup = setup,
 	.test_all = run,
 	.cleanup = cleanup,
-	.needs_cgroup_controllers = (const char *const []){ "memory", NULL },
+	.needs_cgroup_ctrls = (const char *const []){ "memory", NULL },
 	...
 };
 -------------------------------------------------------------------------------
 
 Above, we first ensure the memory controller is available on the
-test's CGroup with '.needs_cgroup_controllers'. This populates a structure,
+test's CGroup with '.needs_cgroup_ctrls'. This populates a structure,
 'tst_cg', which represents the test's CGroup.
 
 We then write the current processes PID into 'cgroup.procs', which
@@ -2217,7 +2217,7 @@  static void cleanup(void)
 struct tst_test test = {
 	.setup = setup,
 	.test_all = run,
-	.needs_cgroup_controllers = (const char *const []){
+	.needs_cgroup_ctrls = (const char *const []){
 		"cpuset",
 		"memory",
 		NULL
diff --git a/include/tst_cgroup.h b/include/tst_cgroup.h
index d32d62399..08d1339a2 100644
--- a/include/tst_cgroup.h
+++ b/include/tst_cgroup.h
@@ -115,7 +115,7 @@  void tst_cg_print_config(void);
 
 /* Ensure the specified controller is available in the test's default
  * CGroup, mounting/enabling it if necessary. Usually this is not
- * necesary use tst_test.needs_cgroup_controllers instead.
+ * necessary use tst_test.needs_cgroup_ctrls instead.
  */
 void tst_cg_require(const char *const ctrl_name,
 			const struct tst_cg_opts *const options)
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 4a196fc46..4b4dd125d 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1259,7 +1259,7 @@  static void do_setup(int argc, char *argv[])
 	if (tst_test->needs_cgroup_ctrls)
 		do_cgroup_requires();
 	else if (tst_test->needs_cgroup_ver)
-		tst_brk(TBROK, "needs_cgroup_ver only works with needs_cgroup_controllers");
+		tst_brk(TBROK, "tst_test->needs_cgroup_ctrls must be set");
 }
 
 static void do_test_setup(void)