strip_expr: strip out known true false conditionals
commitf4eb11b6390d5287cca28a2d8af206c47d5f6624
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 7 Nov 2014 08:03:03 +0000 (7 11:03 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 7 Nov 2014 08:03:03 +0000 (7 11:03 +0300)
tree2dea53259af70708249a5c81b4b4c1853c584667
parentfa29d8aa153f2d7a4f28af4c36fef9da2c73b22a
strip_expr: strip out known true false conditionals

This changes:  "(1) ? foo : bar" to just "foo".

If I recall correctly this is for handling cpu_to_le32() and friends.  For
those functions we want to pretend the bytes swapping didn't happen.  That
makes it easier to remember the value.  It's ok to record a fake value for
the byte swapped data because hopefully the kernel swaps it back before
using it for anything.

Smatch always says that __builtin_constant_p() is false.

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