Messages in this thread | | | Date | Fri, 3 Feb 2012 10:09:29 +0100 | From | Ingo Molnar <> | Subject | Re: [patch cr 2/4] [RFC] syscalls, x86: Add __NR_kcmp syscall v7 |
| |
* Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> > > + get_random_bytes(&cookies[i][j], > > > + sizeof(cookies[i][j])); > > > > ugly line break. > > > > Why? Looks pretty good to me. But sure I'll change it.
It's ugly because it serves no purpose other than pacifying checkpatch and makes the code *uglier*.
It's a disease. When checkpatch tells you "this line is too long" then consider it a code cleanliness warning!
And code readability and cleanliness is not improved by random line- breaks, right?
'breaking the line' is the *wrong fix* in roughly 90% of the cases.
So instead of dumbly breaking the line you need to think about *WHY* the line got too long, not just mechanically work around the checkpatch warning!
Too long lines can have many reasons, it's usually one of several reasons:
- too much nesting due to too large function. solution: break up the function or: - too verbose statements with not enough abbreviation solution: find a more compact way to write it
or if the code looks compact enough and is not over-nested then *leave the line alone*. By breaking it you have not improved - you have made it worse.
Thanks,
Ingo
| |