summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/ftrace/ftracetest
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2017-07-07 04:03:36 +0300
committerShuah Khan <shuahkh@osg.samsung.com>2017-07-27 00:41:43 +0300
commit97e49368515830586b09ccadcdc567283b11afb9 (patch)
tree393bd1651473f9361765549f65fa9d2cdacddf66 /tools/testing/selftests/ftrace/ftracetest
parent97bece60ef87d813cbe6f8f9b8e532a6a95d422a (diff)
downloadlinux-97e49368515830586b09ccadcdc567283b11afb9.tar.xz
selftests: ftrace: Check given string is not zero-length
Use [ ! -z "$VAR" ] instead of [ "$VAR" ] to check whether the given string variable is not zero-length since it obviously shows what it means. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Acked-by: Steven Rostedt (VMware) <srostedt@goodmis.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/ftrace/ftracetest')
-rwxr-xr-xtools/testing/selftests/ftrace/ftracetest6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index cce1a0c26daf..abc706cf7702 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -8,7 +8,7 @@
# Released under the terms of the GPL v2.
usage() { # errno [message]
-[ "$2" ] && echo $2
+[ ! -z "$2" ] && echo $2
echo "Usage: ftracetest [options] [testcase(s)] [testcase-directory(s)]"
echo " Options:"
echo " -h|--help Show help message"
@@ -50,7 +50,7 @@ parse_opts() { # opts
local OPT_TEST_CASES=
local OPT_TEST_DIR=
- while [ "$1" ]; do
+ while [ ! -z "$1" ]; do
case "$1" in
--help|-h)
usage 0
@@ -96,7 +96,7 @@ parse_opts() { # opts
;;
esac
done
- if [ "$OPT_TEST_CASES" ]; then
+ if [ ! -z "$OPT_TEST_CASES" ]; then
TEST_CASES=$OPT_TEST_CASES
fi
}