CodingStyle indentation and alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux