lkml.org 
[lkml]   [2019]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Ksummit-discuss] [PATCH v2 3/3] libnvdimm, MAINTAINERS: Maintainer Entry Profile
From
Date
On 9/12/19 12:13 AM, Dan Carpenter wrote:
> On Wed, Sep 11, 2019 at 08:48:59AM -0700, Dan Williams wrote:
>> +Coding Style Addendum
>> +---------------------
>> +libnvdimm expects multi-line statements to be double indented. I.e.
>> +
>> + if (x...
>> + && ...y) {
>
> That looks horrible and it causes a checkpatch warning. :( Why not
> do it the same way that everyone else does it.
>
> if (blah_blah_x && <-- && has to be on the first line for checkpatch
> blah_blah_y) { <-- [tab][space][space][space][space]blah
>
> Now all the conditions are aligned visually which makes it readable.
> They aren't aligned with the indent block so it's easy to tell the
> inside from the if condition.


I came across this while sending patches to libnvdimm subsystem. W.r.t
coding Style can we have consistent styles across the kernel? Otherwise,
one would have to change the editor settings as they work across
different subsystems in the kernel. In this specific case both
clang-format and emacs customization tip in the kernel documentation
directory suggest the later style.

-aneesh


\
 
 \ /
  Last update: 2019-09-13 04:13    [W:0.220 / U:1.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site