param_set/filter: PARAM_SET instead of PARAM_ADD
commit73ee321f3778b6e5adbf5f6ea5df053cdbf7726d
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Dec 2017 15:14:49 +0000 (6 18:14 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Dec 2017 15:14:49 +0000 (6 18:14 +0300)
tree28c8eca5dedd138b911af945bf39d6e46498fbd2
parent1f2eb5eb8f0e201153bd213682ddeb788af23598
param_set/filter: PARAM_SET instead of PARAM_ADD

The difference between PARAM_SET and PARAM_ADD is that PARAM_SET doesn't
save the values that we passed in.  It uses a call to
param_has_filter_data() to see if it should be PARAM_SET or PARAM_ADD.

The bug is that param_has_filter_data() assumes that if a parameter has not
been set then it means it has filter data.  But param_filter doesn't save
everything.  So this is a hack but it should work for most things which is
that we look up if a parameter has been assigned and if so then that means
it doesn't have filter data.

There are possibly other places with no filter_data which should still be
PARAM_SET but this is at least an improvement...

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_param_filter.c