All of lore.kernel.org
 help / color / mirror / Atom feed
* CodingStyle indentation and alignment
@ 2016-09-26 17:28 Laurence Rochfort
  2016-09-26 19:32 ` Andrey Utkin
  2016-09-27 10:26 ` Bernd Petrovitsch
  0 siblings, 2 replies; 6+ messages in thread
From: Laurence Rochfort @ 2016-09-26 17:28 UTC (permalink / raw)
  To: kernelnewbies

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-27 14:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-26 17:28 CodingStyle indentation and alignment Laurence Rochfort
2016-09-26 19:32 ` 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

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.