Re: [PATCH] checkpatch giving bogus advice (was staging: goldfish: Fix minor coding style)

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

 



On Mon, 2014-12-15 at 14:59 +0300, Dan Carpenter wrote:
> I prefer !foo because it is more common in the kernel and I think it's
> easier to read but I don't feel strongly about this.

Me too.  But I do prefer consistency.

fyi: for variants of:

	"if (!foo)"
vs
	"if (foo == NULL)"

a little cocci script shows a preference for "if (!foo)"
of >5:1 in drivers/net/
(actual: 11557:2145)
and a little less (>3:1) in net/
(actual: 10263:3045)

$ cat pointer_style.cocci
@@
type T;
T *a;
@@

*	a == NULL

@@
type T;
T *a;
@@

*	a != NULL

@@
type T;
T *a;
@@

*	!a


_______________________________________________
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