db: handle functions that return a container_of()
commitef265b1cba7f05f4cd5c73e3869a7b1e5de7ec7f
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Oct 2017 12:12:15 +0000 (11 15:12 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Oct 2017 12:12:15 +0000 (11 15:12 +0300)
treef5a7b26d85e23416fc91a64bf84038927588f028
parent24733bd015ae0f220e8d960533ddb2d969418fee
db: handle functions that return a container_of()

It's pretty common to have functions which are just a wrapper around
container_of() like so:

static struct my_foo *bar_to_foo(struct my_bar *p)
{
return container_of(p, struct my_foo, p);
}

This patch adds support for that.  We return a CONTAINER with the param
and the offset.  Then when we get it, we save that it's a param_used and
if we have any states from caller_info then we copy those to the
appropriate variables.

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