Shared publicly  - 
 
When you write:

if (ret) {
one_line_statement();
}

somewhere, a puppy dies. And the DRM guys just took out an entire kennel.
21
5
Anand Kumria's profile photoJesse Barnes's profile photokarthikeyan S's profile photoAlan Cox's profile photo
9 comments
 
Is that 7 puppies dead with the last pull? They were probably buried under a pile of radeon chipset variations.
Alan Cox
+
2
1
2
1
 
If thats enough to kill a puppy then the console layer should have wiped out the species
 
generally its because +Jesse Barnes adds DRM_ERROR in every return path and we have a sed script to remove them :-P
 
I always considered NOT putting in the braces a sign of a broken coding convention.
 
Honestly, I also prefer having the braces there. It makes diffs more readable if for one reason or the other you actually add more code to the block (if-branch) or happen to remove the second to last statement from it.
On the other hand, I find the name "one_line_statement" a bit odd. Single_instruction, single_statement or something to that matter seems more precise, as you can fit a lot of instructions into a single line in C/C++ (and many other languages) - despite that certainly being bad practice.
 
I love adding the brace because from times to times i add printk there ... the good old printk debuging. Yes sometimes i can't figure out which code path is taken. So i am to blame for radeon ones but i love them :)

Just blame me for being lazy in advance and not wanting to { } when adding printk for debugging
 
Isn't he pointing out that in error paths proper cleanup has to be done rather than just returning or whatever?