]> git.baikalelectronics.ru Git - kernel.git/commit
kselftest: ftrace: Fix to compare a zero-filled hex value
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 23 Mar 2017 13:33:32 +0000 (22:33 +0900)
committerShuah Khan <shuahkh@osg.samsung.com>
Tue, 11 Apr 2017 15:39:06 +0000 (09:39 -0600)
commite8474b3e35ef88ee11985a155a4628fe11cc187b
treeef6b5045d9ff1958b02b9b5046d59aba71456d67
parent338c6aa18d87f2dc65066a60882280f26b6f332d
kselftest: ftrace: Fix to compare a zero-filled hex value

Fix to compare a zero-filled hexadecimal value with a part of
string of long hexadecimal value.

In check_types(), the last part of testcase compares with
the hex value formatted by "%x" with a part of a string of
long hex value (trimmed by tail -c and head -c). However,
if that part of long hex value contains zero (e.g. "05" of
"a3082059"), printf generated value (e.g. "5") is diffrent
string, and the test case failed.

To fix this, pass "%02x" instead of "%x" to printf.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc