diff mbox series

[RFC,v2,3/6] check: make a few variables local

Message ID 20220627222256.14175-4-ddiss@suse.de (mailing list archive)
State New, archived
Headers show
Series check: add option to rerun failed tests | expand

Commit Message

David Disseldorp June 27, 2022, 10:22 p.m. UTC
The variables aren't used outside of function scope. Also convert one
timestamp output to use the helper.

Signed-off-by: David Disseldorp <ddiss@suse.de>
---
 check | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Darrick J. Wong June 28, 2022, 2:56 p.m. UTC | #1
On Tue, Jun 28, 2022 at 12:22:53AM +0200, David Disseldorp wrote:
> The variables aren't used outside of function scope. Also convert one
> timestamp output to use the helper.
> 
> Signed-off-by: David Disseldorp <ddiss@suse.de>

Looks good,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  check | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/check b/check
> index 9d60df45..f973dd28 100755
> --- a/check
> +++ b/check
> @@ -176,10 +176,10 @@ get_all_tests()
>  # the function from that list.
>  trim_test_list()
>  {
> -	test_list="$*"
> +	local test_list="$*"
>  
>  	rm -f $tmp.grep
> -	numsed=0
> +	local numsed=0
>  	for t in $test_list
>  	do
>  	    if [ $numsed -gt 100 ]; then
> @@ -204,7 +204,7 @@ _wallclock()
>  
>  _timestamp()
>  {
> -    now=`date "+%T"`
> +    local now=`date "+%T"`
>      echo -n " [$now]"
>  }
>  
> @@ -600,7 +600,7 @@ fi
>  
>  function run_section()
>  {
> -	local section=$1
> +	local section=$1 skip
>  
>  	OLD_FSTYP=$FSTYP
>  	OLD_TEST_FS_MOUNT_OPTS=$TEST_FS_MOUNT_OPTS
> @@ -817,7 +817,7 @@ function run_section()
>  		rm -f core $seqres.notrun
>  
>  		start=`_wallclock`
> -		$timestamp && echo -n "	["`date "+%T"`"]"
> +		$timestamp && _timestamp
>  		[ ! -x $seq ] && chmod u+x $seq # ensure we can run it
>  		$LOGGER_PROG "run xfstest $seqnum"
>  		if [ -w /dev/kmsg ]; then
> -- 
> 2.35.3
>
diff mbox series

Patch

diff --git a/check b/check
index 9d60df45..f973dd28 100755
--- a/check
+++ b/check
@@ -176,10 +176,10 @@  get_all_tests()
 # the function from that list.
 trim_test_list()
 {
-	test_list="$*"
+	local test_list="$*"
 
 	rm -f $tmp.grep
-	numsed=0
+	local numsed=0
 	for t in $test_list
 	do
 	    if [ $numsed -gt 100 ]; then
@@ -204,7 +204,7 @@  _wallclock()
 
 _timestamp()
 {
-    now=`date "+%T"`
+    local now=`date "+%T"`
     echo -n " [$now]"
 }
 
@@ -600,7 +600,7 @@  fi
 
 function run_section()
 {
-	local section=$1
+	local section=$1 skip
 
 	OLD_FSTYP=$FSTYP
 	OLD_TEST_FS_MOUNT_OPTS=$TEST_FS_MOUNT_OPTS
@@ -817,7 +817,7 @@  function run_section()
 		rm -f core $seqres.notrun
 
 		start=`_wallclock`
-		$timestamp && echo -n "	["`date "+%T"`"]"
+		$timestamp && _timestamp
 		[ ! -x $seq ] && chmod u+x $seq # ensure we can run it
 		$LOGGER_PROG "run xfstest $seqnum"
 		if [ -w /dev/kmsg ]; then