*new* or_vs_and: complain about if (x != 3 || x != 4) { ...
commitdad9097fc1dc5e62fe9207b17341dd248c869815
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Apr 2012 12:20:17 +0000 (26 15:20 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Apr 2012 12:20:17 +0000 (26 15:20 +0300)
tree14278bea226fc4630c9550d3bb3baf2f9f08ca61
parent2f20516480062187b433e07620f5df558481a068
*new* or_vs_and: complain about if (x != 3 || x != 4) { ...

Sometimes people type:
if (x != 3 || x != 4) { ...
when:
if (x != 3 && x != 4) { ...
was intended.

This is a fairly common mistake but other people have found most of these
bugs in the kernel.  This test currently finds 2 bugs and 0 false
positives.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_list.h
check_or_vs_and.c [new file with mode: 0644]