extra: fix and improve used_param_value_info()
commitc4321a6e5251fa2d1b8ee7869b967069ace35b0c
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 11 Jun 2024 15:27:37 +0000 (11 18:27 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Tue, 11 Jun 2024 15:27:37 +0000 (11 18:27 +0300)
tree9a334fe024d5ea76b7c31006cde1297e906b8308
parentd3156bf6fb7b4bd1e70dfff438b494cc0f978136
extra: fix and improve used_param_value_info()

I was fixing this code and I noticed that the return from the
call_is_leaf_fn() path is reversed.  I'm not sure how this worked...
Re-write it to to be more readable and fix the bugs.

Functional changes:
1) Either long variables or -> -> -> variables are considered long.  Btw,
   40 characters is very long.
2) Consider $ and *$ before the leaf check.
3) NULL/non-NULL pointers are useless if they are a long variable.  (The
   reason why they would be considered useful at all is because of error
   pointers)

Style changes:
1) Use get_row_count().  This is just way cleaner.
2) Rename the function to used_param_value_info().
3) Reverse the returns so it returns true for used and false for unused.
4) Change the type to bool.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
smatch.h
smatch_db.c
smatch_extra.c
smatch_function_ptrs.c