function_hooks: fix up db_compare_callback()
commit564d5ceedc812f879ffe1183eeb18f581e3fec16
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Mar 2015 12:03:46 +0000 (20 15:03 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Mar 2015 12:03:46 +0000 (20 15:03 +0300)
tree8e12183827457e52b301942bf0735a2712a44022
parentec72b1f3b3df646525d57ee897d654b4755f56f4
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>
smatch_function_hooks.c