[PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

Christopher Li sparse at chrisli.org
Mon Jun 30 18:32:21 UTC 2014


On Mon, Jun 30, 2014 at 10:49 AM, Christopher Li <sparse at chrisli.org> wrote:
> The warning should be trivial in instruction level. We are looking
> for an instruction has larger than type size constant shift
> value.

Actually, just try it. Not as trivial as I thought.

The problem is that, in the instruction level, sparse will optimize away
the shift instruction when it see a larger than type size shift.
The finial instruction level don't see the big constant shift any way.
Need to catch it before the instruction get optimized away.

That is unfortunate. If we check it too early, we can't tell it is in the
dead code. If we check it too late, the instruction itself get optimized
away.

Chris


More information about the devel mailing list