capped: fix handling of assignments
The problem that this change tries to address is:
if (x > foo)
return;
// x is now capped
if (x < 0)
x = 0; // <- this assignement makes it uncapped
When we're handling this assignment the modification hook first sets it
to uncapped. Then this assignment can set things back to capped. The
!is_capped() condition makes no sense, because it won't be capped.
If it's a += assignment then that's uncapped. If the right hand side is
capped then it's capped. If we had a state and we're setting it to a
partial range then set it to capped. (If we don't have a state then forget
about it).
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>