Skip to content
Commit 0e27d27e authored by Peter Senna Tschudin's avatar Peter Senna Tschudin Committed by Michael Ellerman
Browse files

selftests/powerpc: Return false instead of -1 in require_paranoia_below()



Returning a negative value for a boolean function seem to have the
undesired effect of returning true. require_paranoia_below() is a
boolean function, but the variable used to store the return value is an
integer, receiving -1 or 0. This patch converts rc to bool, replaces -1
by false, and 0 by true.

mpe: This wasn't exhibiting in practice because the common case, where
we do the comparison of the desired level vs the current value, was
being compiled into a computation based on the result of the comparison,
ie. it wasn't using the default -1 value at all. However that was just
luck and the code is still wrong.

Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: default avatarAndrew Shadura <andrew.shadura@collabora.co.uk>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 99e5cde5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment