function_hooks: fix up db_compare_callback()
First here is the cleanup: This code is written if a really confusing way.
Normally people write code like this:
if (variable < function())
But Smatch instead flips it around and does this:
if (function() >= variable)
Which is confusing.
The bugs are:
1) It seems to filter the returned results from function() instead of the
original variable values. What? How is that even supposed to work.
2) It wasn't setting the return state for the last slist meaning that
the result was always undefined for that path. Oops.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>