You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/06/02 14:09:40 UTC

[incubator-nuttx] 22/31: Code style fixes

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch SocketCAN
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 80582342e991014f5026ba6638f8fde617f2cce0
Author: Jari van Ewijk <ja...@nxp.com>
AuthorDate: Fri Mar 13 13:48:10 2020 +0100

    Code style fixes
---
 fs/vfs/fs_write.c         |  3 ++-
 include/netpacket/can.h   | 46 +++++++++++++++++++++++-----------------------
 include/nuttx/can/error.h | 10 ++++++----
 include/nuttx/mm/iob.h    |  6 ++++--
 include/nuttx/net/can.h   | 10 ++++------
 include/nuttx/net/net.h   |  2 +-
 6 files changed, 40 insertions(+), 37 deletions(-)

diff --git a/fs/vfs/fs_write.c b/fs/vfs/fs_write.c
index ef5f137..b48812e 100644
--- a/fs/vfs/fs_write.c
+++ b/fs/vfs/fs_write.c
@@ -86,7 +86,8 @@
  *
  ****************************************************************************/
 
-ssize_t file_write(FAR struct file *filep, FAR const void *buf, size_t nbytes)
+ssize_t file_write(FAR struct file *filep, FAR const void *buf,
+                   size_t nbytes)
 {
   FAR struct inode *inode;
 
diff --git a/include/netpacket/can.h b/include/netpacket/can.h
index 0b4c7b9..4ea2104 100644
--- a/include/netpacket/can.h
+++ b/include/netpacket/can.h
@@ -102,37 +102,37 @@ struct sockaddr_can
   sa_family_t can_family;
   int16_t     can_ifindex;
   union
-    {
-      /* Transport protocol class address information */
+  {
+    /* Transport protocol class address information */
 
-      struct
-      {
-        canid_t rx_id;
-        canid_t tx_id;
-      } tp;
+    struct
+    {
+      canid_t rx_id;
+      canid_t tx_id;
+    } tp;
 
-      /* J1939 address information */
+    /* J1939 address information */
 
-      struct
-      {
-        /* 8 byte name when using dynamic addressing */
+    struct
+    {
+      /* 8 byte name when using dynamic addressing */
 
-        uint64_t name;
+      uint64_t name;
 
-        /* pgn:
-         *   8 bit: PS in PDU2 case, else 0
-         *   8 bit: PF
-         *   1 bit: DP
-         *   1 bit: reserved
-         */
+      /* pgn:
+       *   8 bit: PS in PDU2 case, else 0
+       *   8 bit: PF
+       *   1 bit: DP
+       *   1 bit: reserved
+       */
 
-        uint32_t pgn;
+      uint32_t pgn;
 
-        /* 1 byte address */
+      /* 1 byte address */
 
-        uint8_t addr;
-      } j1939;
-    } can_addr;
+      uint8_t addr;
+    } j1939;
+  } can_addr;
 };
 
 #endif /* __INCLUDE_NETPACKET_CAN_H */
diff --git a/include/nuttx/can/error.h b/include/nuttx/can/error.h
index 3463328..d9c2396 100644
--- a/include/nuttx/can/error.h
+++ b/include/nuttx/can/error.h
@@ -60,7 +60,8 @@
 
 /* arbitration lost in bit ... / data[0] */
 #define CAN_ERR_LOSTARB_UNSPEC   0x00 /* unspecified */
-				      /* else bit number in bitstream */
+
+/* else bit number in bitstream */
 
 /* error status of CAN-controller / data[1] */
 #define CAN_ERR_CRTL_UNSPEC      0x00 /* unspecified */
@@ -70,8 +71,8 @@
 #define CAN_ERR_CRTL_TX_WARNING  0x08 /* reached warning level for TX errors */
 #define CAN_ERR_CRTL_RX_PASSIVE  0x10 /* reached error passive status RX */
 #define CAN_ERR_CRTL_TX_PASSIVE  0x20 /* reached error passive status TX */
-				      /* (at least one error counter exceeds */
-				      /* the protocol-defined level of 127)  */
+                                      /* (at least one error counter exceeds */
+                                      /* the protocol-defined level of 127)  */
 #define CAN_ERR_CRTL_ACTIVE      0x40 /* recovered to error active state */
 
 /* error in CAN protocol (type) / data[2] */
@@ -108,7 +109,8 @@
 #define CAN_ERR_PROT_LOC_INTERM  0x12 /* intermission */
 
 /* error status of CAN-transceiver / data[4] */
-/*                                             CANH CANL */
+
+                                            /* CANH CANL */
 #define CAN_ERR_TRX_UNSPEC             0x00 /* 0000 0000 */
 #define CAN_ERR_TRX_CANH_NO_WIRE       0x04 /* 0000 0100 */
 #define CAN_ERR_TRX_CANH_SHORT_TO_BAT  0x05 /* 0000 0101 */
diff --git a/include/nuttx/mm/iob.h b/include/nuttx/mm/iob.h
index e986105..32c0bfd 100644
--- a/include/nuttx/mm/iob.h
+++ b/include/nuttx/mm/iob.h
@@ -252,7 +252,8 @@ void iob_initialize(void);
  * Name: iob_alloc
  *
  * Description:
- *   Allocate an I/O buffer by taking the buffer at the head of the free list.
+ *   Allocate an I/O buffer by taking the buffer at the head of the free
+ *   list.
  *
  ****************************************************************************/
 
@@ -590,7 +591,8 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
  * Name: iob_getuserstats
  *
  * Description:
- *   Return a reference to the IOB usage statistics for the IOB consumer/producer
+ *   Return a reference to the IOB usage statistics for the IOB
+ *   consumer/producer
  *
  * Input Parameters:
  *   userid - id representing the IOB producer/consumer
diff --git a/include/nuttx/net/can.h b/include/nuttx/net/can.h
index d426c7b..9cda480 100644
--- a/include/nuttx/net/can.h
+++ b/include/nuttx/net/can.h
@@ -53,15 +53,15 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define CAN_HDRLEN 4 //FIXME standard id vs extended
-#define NET_CAN_PKTSIZE sizeof(struct canfd_frame) // max size we can send through socket
-//FIXME think about can & canfd support
+#define CAN_HDRLEN 4                               /* FIXME standard id vs extended */
+#define NET_CAN_PKTSIZE sizeof(struct canfd_frame) /* max size we can send through socket*/
+
+/* FIXME think about can & canfd support */
 
 /****************************************************************************
  * Public Types
  ****************************************************************************/
 
-
 /****************************************************************************
  * Public Data
  ****************************************************************************/
@@ -74,8 +74,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-
-
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index 30808b1..27c5fe9 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -217,7 +217,7 @@ struct sock_intf_s
                     FAR socklen_t *fromlen);
 #ifdef CONFIG_NET_RECVMSG_CMSG
   CODE ssize_t    (*si_recvmsg)(FAR struct socket *psock,
-		            FAR struct msghdr *msg, int flags);
+                FAR struct msghdr *msg, int flags);
 #endif
   CODE int        (*si_close)(FAR struct socket *psock);
 #ifdef CONFIG_NET_USRSOCK