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

Re: coding style



Tyler wrote:
> Hi all,
> 
> I've a question about the linux kernel coding style. I haven't found the
> 
> answer in Documentation/CodingStyle
> Do we write :
> 
> if (!test) {
> 	...
> }
> 
> or
> 
> if (! test) {
> 	...
> }

For things like this, you can sometimes check to see
what is the most common usage in the source:

[linux-2.6.12.2]$ find . -name "*.[ch]" -exec grep "if (\![a-z]" {} \; | wc -l
36936
[linux-2.6.12.2]$ find . -name "*.[ch]" -exec grep "if (\![ ]" {} \; | wc -l
1206


Looks like "no space" is far more common and is
probably preferred.
 -- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Electronics
=============================


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/