Unify indentation in struct elmcan
[elmcan.git] / module / elmcan.c
index 198ef512021a51b77b5943e6343a5bc9e3b8204a..106ae109585bb8a1997955d24a755dbb3676da4c 100644 (file)
@@ -4,9 +4,14 @@
  * This driver started as a derivative of linux/drivers/net/can/slcan.c
  * and my thanks go to the original authors for their inspiration, even
  * after almost none of their code is left.
+ *
+ * elmcan.c Author : Max Staudt <max-linux@enpas.org>
+ * slcan.c Author  : Oliver Hartkopp <socketcan@hartkopp.net>
+ * slip.c Authors  : Laurence Culhane <loz@holmes.demon.co.uk>
+ *                   Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>
  */
 
-#define pr_fmt(fmt) "[elmcan] " fmt
+#define pr_fmt(fmt) "elmcan: " fmt
 
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/can/led.h>
 #include <linux/can/rx-offload.h>
 
-MODULE_ALIAS_LDISC(N_DEVELOPMENT);
-MODULE_DESCRIPTION("ELM327 based CAN interface");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Max Staudt <max-linux@enpas.org>");
-
 /* Line discipline ID number.
  * N_DEVELOPMENT will likely be defined from Linux 5.18 onwards:
  * https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git/commit/?h=tty-next&id=c2faf737abfb10f88f2d2612d573e9edc3c42c37
@@ -89,11 +89,11 @@ struct elmcan {
        struct can_rx_offload offload;
 
        /* TTY and netdev devices that we're bridging */
-       struct tty_struct       *tty;
-       struct net_device       *dev;
+       struct tty_struct *tty;
+       struct net_device *dev;
 
        /* Per-channel lock */
-       spinlock_t              lock;
+       spinlock_t lock;
 
        /* Keep track of how many things are using this struct.
         * Once it reaches 0, we are in the process of cleaning up,
@@ -102,18 +102,18 @@ struct elmcan {
         * decrement to 0, and refcount_dec() spills a WARN_ONCE in
         * that case.
         */
-       atomic_t                refcount;
+       atomic_t refcount;
 
        /* Stop the channel on hardware failure.
         * Once this is true, nothing will be sent to the TTY.
         */
-       bool                    hw_failure;
+       bool hw_failure;
 
        /* TTY TX helpers */
-       struct work_struct      tx_work;        /* Flushes TTY TX buffer   */
-       unsigned char           *txbuf;
-       unsigned char           *txhead;        /* Pointer to next TX byte */
-       int                     txleft;         /* Bytes left to TX */
+       struct work_struct tx_work;     /* Flushes TTY TX buffer   */
+       unsigned char *txbuf;
+       unsigned char *txhead;          /* Pointer to next TX byte */
+       int txleft;                     /* Bytes left to TX */
 
        /* TTY RX helpers */
        unsigned char rxbuf[ELM327_SIZE_RXBUF];
@@ -1282,3 +1282,8 @@ static void __exit elmcan_exit(void)
 
 module_init(elmcan_init);
 module_exit(elmcan_exit);
+
+MODULE_ALIAS_LDISC(N_DEVELOPMENT);
+MODULE_DESCRIPTION("ELM327 based CAN interface");
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Max Staudt <max-linux@enpas.org>");