[PATCH] selftests/cgroup: Fix incorrect variable check in online_cpus()

Hongfu Li posted 1 patch 1 month ago
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] selftests/cgroup: Fix incorrect variable check in online_cpus()
Posted by Hongfu Li 1 month ago
"OFFLINE_CPUS" is a literal string that is always non-empty. It should
be "$OFFLINE_CPUS" to check the variable's value instead.

Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
---
 tools/testing/selftests/cgroup/test_cpuset_prs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
index a56f4153c64d..df89ddfa073f 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -617,7 +617,7 @@ set_ctrl_state_noerr()
 
 online_cpus()
 {
-	[[ -n "OFFLINE_CPUS" ]] && {
+	[[ -n "$OFFLINE_CPUS" ]] && {
 		for C in $OFFLINE_CPUS
 		do
 			write_cpu_online ${C}=1
-- 
2.25.1
Re: [PATCH] selftests/cgroup: Fix incorrect variable check in online_cpus()
Posted by Tejun Heo 1 month ago
Hello,

> Hongfu Li (1):
>   selftests/cgroup: Fix incorrect variable check in online_cpus()

Applied to cgroup/for-7.2.

Thanks.

--
tejun