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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 28, 2014 at 8:09 PM, Christopher Li <sparse@xxxxxxxxxxx> wrote:
> So if there is a bug, It is sparse did not know exactly which part
> of the code is dead on AST level. If you enable the "#if 0" inside

I am thinking about how to fix the dead code issue. Try to do more
than trivial dead code analyses is really not the right place for AST.

Actually, there is a simple way out. We can just move the warning
to the linearize instruction level.

 $ ./test-linearize /tmp/test_shift.c
/tmp/test_shift.c:8:26: warning: shift too big (4294967295) for type int
main:
.L0x7f8f490e5010:
    <entry-point>
    # call      %r1 <- filter, $0xffffffff
    ret.32      $0

You see, once drop into the instruction level, sparse already
know that code is dead.

Since the sparse is already linearizing instruction to perform
the context check. We just need to move the warning from AST
to instruction level.

The warning should be trivial in instruction level. We are looking
for an instruction has larger than type size constant shift
value.

Comments and feed backs, even patches?

Chris
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux