cgroup_xattr: Remove unused variable
PATCH 1/1 cgroup_xattr: Remove unused variable
The dir variable in mount_cgroup() is uninitialized but it gets printed into error messages instead of the correct opt->dir. Remove the variable and fix the error message.
Signed-off-by Martin Doucha <[email protected]>
--- testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c +1 -2
@@ -289,7 +289,6 @@ int mount_cgroup(void)int i, any_mounted =0 ;for (i =0 ; i < cgrp_opt_num; ++i) { -char dir[MAX_DIR_NAME ];struct cgrp_option *opt = &cgrp_opt[i];tst_resm (TINFO ,"mount options %d: %s (hier = %d)" , i, opt->str, opt->hier);
@@ -297,7 +296,7 @@ int mount_cgroup(void)SAFE_MKDIR (cleanup, opt->dir,0755 );if (mount (opt->dir, opt->dir,"cgroup" ,0 , opt->str) ==-1 ) { -tst_resm (TINFO ,"Can't mount: %s" , dir); +tst_resm (TINFO ,"Can't mount: %s" , opt->dir);continue ; }
Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Reviewed-by Andrea Cervesato <[email protected]>
Signature · 7 lines
Andrea Cervesato SUSE QE Automation Engineer Linux [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Martin, Andrea,
good catch, merged. Thanks!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp