btrfs-progs: tests: remove trivial use of local variables
authorDavid Sterba <dsterba@suse.com>
Fri, 23 Mar 2018 15:21:37 +0000 (16:21 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Mar 2018 20:15:55 +0000 (22:15 +0200)
No need to use a temporary variable if the parameter usage is obvious
from the context.

Signed-off-by: David Sterba <dsterba@suse.com>
tests/fsck-tests/015-tree-reloc-tree/test.sh
tests/fsck-tests/020-extent-ref-cases/test.sh
tests/fuzz-tests/001-simple-check-unmounted/test.sh
tests/fuzz-tests/002-simple-image/test.sh
tests/fuzz-tests/004-simple-dump-tree/test.sh
tests/fuzz-tests/006-simple-tree-stats/test.sh
tests/misc-tests/002-uuid-rewrite/test.sh
tests/misc-tests/003-zero-log/test.sh

index 21987b0..5d9d512 100755 (executable)
@@ -10,10 +10,7 @@ source "$TEST_TOP/common"
 check_prereq btrfs
 
 check_image() {
-       local image
-
-       image=$1
-       run_check "$TOP/btrfs" check "$image"
+       run_check "$TOP/btrfs" check "$1"
 }
 
 check_all_images
index 9cf99a5..a1bf75b 100755 (executable)
@@ -20,10 +20,7 @@ source "$TEST_TOP/common"
 check_prereq btrfs
 
 check_image() {
-       local image
-
-       image=$1
-       run_check "$TOP/btrfs" check "$image"
+       run_check "$TOP/btrfs" check "$1"
 }
 
 check_all_images
index 84d7ed8..87a6394 100755 (executable)
@@ -9,10 +9,7 @@ check_prereq btrfs
 
 # redefine the one provided by common
 check_image() {
-       local image
-
-       image=$1
-       run_mayfail "$TOP/btrfs" check "$image"
+       run_mayfail "$TOP/btrfs" check "$1"
 }
 
 check_all_images "$TEST_TOP/fuzz-tests/images"
index 0db6190..5dddc9e 100755 (executable)
@@ -9,11 +9,8 @@ check_prereq btrfs-image
 
 # redefine the one provided by common
 check_image() {
-       local image
-
-       image=$1
        truncate -s0 target
-       run_mayfail "$TOP/btrfs-image" "$image" target
+       run_mayfail "$TOP/btrfs-image" "$1" target
        truncate -s0 target
 }
 
index 857c742..c09b847 100755 (executable)
@@ -7,10 +7,7 @@ check_prereq btrfs
 
 # redefine the one provided by common
 check_image() {
-       local image
-
-       image=$1
-       run_mayfail "$TOP/btrfs" inspect-internal dump-tree "$image"
+       run_mayfail "$TOP/btrfs" inspect-internal dump-tree "$1"
 }
 
 check_all_images "$TEST_TOP/fuzz-tests/images"
index cb82e2c..146afa9 100755 (executable)
@@ -7,10 +7,7 @@ check_prereq btrfs
 
 # redefine the one provided by common
 check_image() {
-       local image
-
-       image=$1
-       run_mayfail "$TOP/btrfs" inspect-internal tree-stats "$image"
+       run_mayfail "$TOP/btrfs" inspect-internal tree-stats "$1"
 }
 
 check_all_images "$TEST_TOP/fuzz-tests/images"
index e32aff0..8e7011a 100755 (executable)
@@ -10,10 +10,7 @@ check_prereq btrfs
 prepare_test_dev
 
 get_fs_uuid() {
-       local image
-
-       image="$1"
-       run_check_stdout $TOP/btrfs inspect-internal dump-super "$image" | \
+       run_check_stdout $TOP/btrfs inspect-internal dump-super "$1" | \
                grep '^fsid' | awk '{print $2}'
 }
 
index 9d2940f..51cf6ae 100755 (executable)
@@ -9,17 +9,11 @@ prepare_test_dev
 
 get_log_root()
 {
-       local image
-
-       image="$1"
-       $TOP/btrfs inspect-internal dump-super "$image" | \
+       $TOP/btrfs inspect-internal dump-super "$1" | \
                grep '^log_root\>' | awk '{print $2}'
 }
 get_log_root_level() {
-       local image
-
-       image="$1"
-       $TOP/btrfs inspect-internal dump-super "$image" | \
+       $TOP/btrfs inspect-internal dump-super "$1" | \
                grep '^log_root_level' | awk '{print $2}'
 }