Re: [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure

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

 



Yes.  I know Al's thoughts and kernel style.

But Alan Cox and Andreas have both said they think (x == NULL) can help
you avoid some kind of boolean vs pointer bugs.  I've had co-workers who
did massive seds changing !foo to foo == NULL on our code base.  But
I've never seen a real life example of a bug this fixes.

To be honest, I've never seen a real life proof that (!foo) code is less
buggy.  I should look through the kbuild mailbox...  Hm...  But my other
idea of setting up code style readability testing website is also a good
one.

Linux kernel style is based on Joe Perches finding that 80% of the code
prefers one way or the other.  That's a valid method for determining
code style.  I bet it normally picks the more readable style but it
would be interesting to measure it more formally.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux