From: laurence.rochfort@gmail.com (Laurence Rochfort)
To: kernelnewbies@lists.kernelnewbies.org
Subject: CodingStyle indentation and alignment
Date: Mon, 26 Sep 2016 18:28:58 +0100 [thread overview]
Message-ID: <20160926172856.GA2190@gmail.com> (raw)
Hi all,
I've read Documentation/CodingStyle and it states to use 8 character tabs.
Reading several USB driver files including drivers/usb/usb-skeleton.c, I see that multi-line lists of argument and operands are often aligned on top of each other using a mixture of tabs and spaces. checkpatch doesn't complain about the mixture.
For instance from usb-skeleton.c:
static int skel_probe(struct usb_interface *interface,
const struct usb_device_id *id)
uses two tabs and 6 spaces, not just tabs like:
static int skel_probe(struct usb_interface *interface,
const struct usb_device_id *id)
or
static int skel_probe(struct usb_interface *interface,
const struct usb_device_id *id)
Is a mixture of tabs and spaces acceptable if it enhances readability? If not, which of the tabs-only forms is correct?
Similarly, what about assignment alignment in structs?
Cheers,
Laurence.
next reply other threads:[~2016-09-26 17:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 17:28 Laurence Rochfort [this message]
2016-09-26 19:32 ` CodingStyle indentation and alignment Andrey Utkin
2016-09-27 14:27 ` Laurence Rochfort
2016-09-27 14:47 ` Andrey Utkin
2016-09-27 14:47 ` Laurence Rochfort
2016-09-27 10:26 ` Bernd Petrovitsch
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=20160926172856.GA2190@gmail.com \
--to=laurence.rochfort@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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.