Skip to content
Commit 9e14ef60 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Shuah Khan
Browse files

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: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Acked-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
parent 7ba31340
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment