From: Mauro Carvalho Chehab <mchehab@kernel.org>
To: Amit Choudhary <amitchoudhary2305@gmail.com>
Cc: kstewart@linuxfoundation.org, linux-kernel@vger.kernel.org,
rfontana@redhat.com, tglx@linutronix.de,
linux-kernel-mentees@lists.linuxfoundation.org,
"Daniel W. S. Almeida" <dwlsalmeida@gmail.com>,
linux-media@vger.kernel.org
Subject: Re: [Linux-kernel-mentees] [PATCH 4/6] media: dvb_dummy_fe: Fix long lines
Date: Mon, 2 Dec 2019 06:35:55 +0100 [thread overview]
Message-ID: <20191202063555.0f75e68f@kernel.org> (raw)
In-Reply-To: <CAFzckaFfmVYV_baqV9bHrnguXfOKs42DJ2VgA4C1y2Ey-+99xQ@mail.gmail.com>
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
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab@kernel.org>
To: Amit Choudhary <amitchoudhary2305@gmail.com>
Cc: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>,
gregkh@linuxfoundation.org, rfontana@redhat.com,
kstewart@linuxfoundation.org, tglx@linutronix.de,
skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/6] media: dvb_dummy_fe: Fix long lines
Date: Mon, 2 Dec 2019 06:35:55 +0100 [thread overview]
Message-ID: <20191202063555.0f75e68f@kernel.org> (raw)
In-Reply-To: <CAFzckaFfmVYV_baqV9bHrnguXfOKs42DJ2VgA4C1y2Ey-+99xQ@mail.gmail.com>
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
next prev parent reply other threads:[~2019-12-02 5:36 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-01 16:15 [Linux-kernel-mentees] [PATCH 0/6] dummy_dvb_fe: Tidy up the dummy frontend Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 1/6] media: dvb_dummy_fe: place EXPORT_SYMBOL below corresponding function Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 2/6] media: dvb_dummy_fe: Add error messages in case of attach failure Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-31 10:20 ` [Linux-kernel-mentees] " Sean Young
2019-12-31 10:20 ` Sean Young
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 3/6] media: dvb_dummy_fe: Fix ERROR: POINTER_LOCATION Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-31 10:08 ` [Linux-kernel-mentees] " Sean Young
2019-12-31 10:08 ` Sean Young
2019-12-31 18:14 ` [Linux-kernel-mentees] " Daniel W. S. Almeida
2019-12-31 18:14 ` Daniel W. S. Almeida
2019-12-31 18:34 ` [Linux-kernel-mentees] " Sean Young
2019-12-31 18:34 ` Sean Young
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 4/6] media: dvb_dummy_fe: Fix long lines Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-01 16:37 ` [Linux-kernel-mentees] " Amit Choudhary
2019-12-01 16:52 ` Fwd: " Amit Choudhary
2019-12-01 16:54 ` Amit Choudhary
2019-12-02 5:35 ` Mauro Carvalho Chehab [this message]
2019-12-02 5:35 ` Mauro Carvalho Chehab
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 5/6] media: dvb_dummy_fe: Add blank line after declaration Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-01 16:15 ` [Linux-kernel-mentees] [PATCH 6/6] media: dvb_dummy_frontend: remove 'extern' keyword from declaration Daniel W. S. Almeida
2019-12-01 16:15 ` Daniel W. S. Almeida
2019-12-31 10:12 ` [Linux-kernel-mentees] " Sean Young
2019-12-31 10:12 ` Sean Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191202063555.0f75e68f@kernel.org \
--to=mchehab@kernel.org \
--cc=amitchoudhary2305@gmail.com \
--cc=dwlsalmeida@gmail.com \
--cc=kstewart@linuxfoundation.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=rfontana@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.