diff mbox series

common/rc: Remove impossible check

Message ID 20211101133511.383232-1-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series common/rc: Remove impossible check | expand

Commit Message

Nikolay Borisov Nov. 1, 2021, 1:35 p.m. UTC
config_ndevs is guaranteed to be defined in _scratch_dev_pool_get
irrespective of whether SCRATCH_DEV_POOL is defined or not. If it's not
then wc -w will simply return 0 which simply sets config_ndevs to 0.
This causes 'typeset -p config_ndevs' to always succeeds and return 0 so
the check for the return value of typeset is effectively a noop. Just
remove it.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 common/rc | 5 -----
 1 file changed, 5 deletions(-)
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 7f693d3922e8..6f7467b574c2 100644
--- a/common/rc
+++ b/common/rc
@@ -921,11 +921,6 @@  _scratch_dev_pool_get()
 	local config_ndevs=`echo $SCRATCH_DEV_POOL| wc -w`
 	local -a devs="( $SCRATCH_DEV_POOL )"
 
-	typeset -p config_ndevs >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-		_fail "Bug: cant find SCRATCH_DEV_POOL ndevs"
-	fi
-
 	if [ $config_ndevs -lt $test_ndevs ]; then
 		_notrun "Need at least test requested number of ndevs $test_ndevs"
 	fi