lkml.org 
[lkml]   [2019]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/6] media: dvb_dummy_fe: Fix long lines
Em Sun, 1 Dec 2019 22:07:22 +0530
Amit Choudhary <amitchoudhary2305@gmail.com> escreveu:

> +static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,
>
> > + u16 *strength)
> >
>
> In my opinion, the arguments on new line should be just below the start of
> arguments on top line. Like this:
>
> +static int dvb_dummy_fe_read_signal_strength(struct dvb_frontend *fe,
> + u16
> *strength)

No, that is not the way we indent. The alignment is relative to the open
parenthesis:

foo(arg1,
arg2);

Btw, if you run checkpatch --strict, you'll see it complaining if the
alignment is different:

CHECK: Alignment should match open parenthesis
#2: FILE: a.c:2:
+void foo(int arg1,
+ int arg2)

> + .caps = FE_CAN_FEC_1_2 |
> > + FE_CAN_FEC_2_3 |

The alignment here is given by the first argument:

bitfield = BIT_1 |
BIT_2 |
BIT_3 |
...

or

bitfield = BIT_1
| BIT_2
| BIT_3
...

On media, we usually prefer the first form.

Cheers,
Mauro

\
 
 \ /
  Last update: 2019-12-02 06:37    [W:0.074 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site