Re: [PATCH] Staging: rtl8188eu: Remove zero testing pointer typed value

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

 



On Fri, 2015-04-03 at 19:51 +0300, Dan Carpenter wrote:
> On Fri, Apr 03, 2015 at 10:12:11PM +0530, Amitoj Kaur Chawla wrote:
> > Removes variable comparison with 0 by using !. 
> 
> Sometimes testing for zero makes sense.
> When you write code, you are
> telling a story.  If you are talking about zero as a number then it
> can make sense.  If it's zero as a boolean then it doesn't make sense.

Very true.

> Also strcmp() and similar should always be done as == 0, < 0 or != 0
> because that is the idiom:

Less true.

When testing for equality, !strcmp is very common.

There are ~2500 uses of !strcmp in the kernel tree vs
~1500 uses of strcmp() == or !=


_______________________________________________
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