How to fix CHECK warning: testing a 'safe expression' ?

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

 



I am trying to address CHECK warnings in my driver and wondering how to resolve 'warning: testing a 'safe expression' which appears when using
IS_ERR_OR_NULL(foo)

where foo is defined as

struct foo_type *foo;

The foo get assigned only NULL or ERR_PTR(error code). So I believe the
usage is correct. But then how do I make the CHECK happy of its usage?

I have tried a grep to check on the current usage of IS_ERR_OR_NULL() and found 276 of them causes this warning in the v3.18 version of the kernel that I am using

$ grep -r "warning: testing a 'safe expression" * | wc -l
276

Can someone help me undestand what this means and how to fix the same?

I run folling for CHECK

make C=2 CF="-D__CHECK_ENDIAN__" CHECK=sparse

Thanks in advance for your suggestions.
--
Murali Karicheri
Linux Kernel, Texas Instruments
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux