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/04/08 14:21:53 UTC

[incubator-nuttx] 23/31: Code style fixes 2

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 2ff15a260ed9c0c1cbd88085b3ba058b0712d4ba
Author: Jari van Ewijk <ja...@nxp.com>
AuthorDate: Fri Mar 13 14:30:32 2020 +0100

    Code style fixes 2
---
 include/nuttx/net/net.h          |  3 ++-
 include/nuttx/wqueue.h           |  8 +++---
 include/sys/socket.h             | 53 ++++++++++++++++++++--------------------
 libs/libc/net/lib_recvmsg.c      |  3 ++-
 net/bluetooth/bluetooth_sockif.c | 34 ++++++++++++++------------
 5 files changed, 53 insertions(+), 48 deletions(-)

diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index 61f1f55..b7d759c 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -739,7 +739,8 @@ int psock_listen(FAR struct socket *psock, int backlog);
  * Input Parameters:
  *   psock    Reference to the listening socket structure
  *   addr     Receives the address of the connecting client
- *   addrlen  Input: allocated size of addr, Return: returned size of addr
+ *   addrlen  Input: allocated size of 'addr',
+ *            Return: returned size of 'addr'
  *   newsock  Location to return the accepted socket information.
  *
  * Returned Value:
diff --git a/include/nuttx/wqueue.h b/include/nuttx/wqueue.h
index 247b56d..5d333c3 100644
--- a/include/nuttx/wqueue.h
+++ b/include/nuttx/wqueue.h
@@ -67,8 +67,8 @@
  *   (which runs at the lowest of priority and may not be appropriate
  *   if memory reclamation is of high priority).  If CONFIG_SCHED_HPWORK
  *   is enabled, then the following options can also be used:
- * CONFIG_SCHED_HPNTHREADS - The number of thread in the high-priority queue's
- *   thread pool.  Default: 1
+ * CONFIG_SCHED_HPNTHREADS - The number of thread in the high-priority
+ *   queue's thread pool.  Default: 1
  * CONFIG_SCHED_HPWORKPRIORITY - The execution priority of the high-
  *   priority worker thread.  Default: 224
  * CONFIG_SCHED_HPWORKSTACKSIZE - The stack size allocated for the worker
@@ -381,8 +381,8 @@ int work_queue(int qid, FAR struct work_s *work, worker_t worker,
  *
  * Description:
  *   Cancel previously queued work.  This removes work from the work queue.
- *   After work has been cancelled, it may be re-queue by calling work_queue()
- *   again.
+ *   After work has been cancelled, it may be re-queue by calling
+ *   work_queue() again.
  *
  * Input Parameters:
  *   qid    - The work queue ID
diff --git a/include/sys/socket.h b/include/sys/socket.h
index ff9f181..b7931d6 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -48,8 +48,8 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* The socket()domain parameter specifies a communication domain; this selects
- * the protocol family which will be used for communication.
+/* The socket()domain parameter specifies a communication domain; this
+ * selects the protocol family which will be used for communication.
  */
 
 /* Supported Protocol Families */
@@ -88,24 +88,24 @@
  * the communication semantics.
  */
 
-#define SOCK_UNSPEC    0 /* Unspecified socket type */
-#define SOCK_STREAM    1 /* Provides sequenced, reliable, two-way,
-                          * connection-based byte streams. An out-of-band data
-                          * transmission mechanism may be supported.
-                          */
-#define SOCK_DGRAM     2 /* Supports  datagrams (connectionless, unreliable
-                          * messages of a fixed maximum length).
-                          */
-#define SOCK_RAW       3 /* Provides raw network protocol access. */
-#define SOCK_RDM       4 /* Provides a reliable datagram layer that does not
-                          * guarantee ordering.
-                          */
-#define SOCK_SEQPACKET 5 /* Provides a sequenced, reliable, two-way
-                          * connection-based data transmission path for
-                          * datagrams of fixed maximum length; a consumer is
-                          * required to read an entire packet with each read
-                          * system call.
-                          */
+#define SOCK_UNSPEC    0  /* Unspecified socket type */
+#define SOCK_STREAM    1  /* Provides sequenced, reliable, two-way,
+                           * connection-based byte streams. An out-of-band
+                           * data transmission mechanism may be supported.
+                           */
+#define SOCK_DGRAM     2  /* Supports  datagrams (connectionless, unreliable
+                           * messages of a fixed maximum length).
+                           */
+#define SOCK_RAW       3  /* Provides raw network protocol access. */
+#define SOCK_RDM       4  /* Provides a reliable datagram layer that does not
+                           * guarantee ordering.
+                           */
+#define SOCK_SEQPACKET 5  /* Provides a sequenced, reliable, two-way
+                           * connection-based data transmission path for
+                           * datagrams of fixed maximum length; a consumer is
+                           * required to read an entire packet with each read
+                           * system call.
+                           */
 #define SOCK_PACKET    10 /* Obsolete and should not be used in new programs */
 
 /* Bits in the FLAGS argument to `send', `recv', et al. These are the bits
@@ -157,10 +157,10 @@
 #define SO_ERROR         4 /* Reports and clears error status (get only).
                             * arg: returns an integer value
                             */
-#define SO_KEEPALIVE     5 /* Keeps connections active by enabling the periodic
-                            * transmission of messages (get/set).
-                            * arg:  pointer to integer containing a boolean int
-                            * value
+#define SO_KEEPALIVE     5 /* Keeps connections active by enabling the
+                            * periodic transmission of messages (get/set).
+                            * arg:  pointer to integer containing a boolean
+                            * int value
                             */
 #define SO_LINGER        6 /* Lingers on a close() if data is present (get/set)
                             * arg: struct linger
@@ -194,8 +194,9 @@
                             * arg: integer value
                             */
 #define SO_SNDTIMEO     14 /* Sets the timeout value specifying the amount of
-                            * time that an output function blocks because flow
-                            * control prevents data from being sent(get/set).
+                            * time that an output function blocks because
+                            * flow control prevents data from being sent
+                            * (get/set).
                             * arg: struct timeval
                             */
 #define SO_TYPE         15 /* Reports the socket type (get only).
diff --git a/libs/libc/net/lib_recvmsg.c b/libs/libc/net/lib_recvmsg.c
index 2513dfa..5200acd 100644
--- a/libs/libc/net/lib_recvmsg.c
+++ b/libs/libc/net/lib_recvmsg.c
@@ -53,7 +53,8 @@
  * Function: recvmsg
  *
  * Description:
- *   The recvmsg() call is identical to recvfrom() with a NULL from parameter.
+ *   The recvmsg() call is identical to recvfrom() with a NULL from
+ *   parameter.
  *
  * Parameters:
  *   sockfd   Socket descriptor of socket
diff --git a/net/bluetooth/bluetooth_sockif.c b/net/bluetooth/bluetooth_sockif.c
index 4f4b936..fd6d95f 100644
--- a/net/bluetooth/bluetooth_sockif.c
+++ b/net/bluetooth/bluetooth_sockif.c
@@ -106,7 +106,7 @@ const struct sock_intf_s g_bluetooth_sockif =
   bluetooth_send,        /* si_send */
   bluetooth_sendto,      /* si_sendto */
 #ifdef CONFIG_NET_SENDFILE
-  NULL,                   /* si_sendfile */
+  NULL,                  /* si_sendfile */
 #endif
   bluetooth_recvfrom,    /* si_recvfrom */
 #ifdef CONFIG_NET_RECVMSG_CMSG
@@ -246,10 +246,10 @@ static void bluetooth_addref(FAR struct socket *psock)
  * Name: bluetooth_connect
  *
  * Description:
- *   bluetooth_connect() connects the local socket referred to by the structure
- *   'psock' to the address specified by 'addr'. The addrlen argument
- *   specifies the size of 'addr'.  The format of the address in 'addr' is
- *   determined by the address space of the socket 'psock'.
+ *   bluetooth_connect() connects the local socket referred to by the
+ *   structure 'psock' to the address specified by 'addr'. The addrlen
+ *   argument specifies the size of 'addr'.  The format of the address in
+ *   'addr' is determined by the address space of the socket 'psock'.
  *
  *   Generally, connection-based protocol sockets may successfully
  *   bluetooth_connect() only once; connectionless protocol sockets may use
@@ -333,7 +333,8 @@ static int bluetooth_connect(FAR struct socket *psock,
  * Input Parameters:
  *   psock    Reference to the listening socket structure
  *   addr     Receives the address of the connecting client
- *   addrlen  Input: allocated size of 'addr', Return: returned size of 'addr'
+ *   addrlen  Input: allocated size of 'addr',
+ *            Return: returned size of 'addr'
  *   newsock  Location to return the accepted socket information.
  *
  * Returned Value:
@@ -375,7 +376,7 @@ static int bluetooth_accept(FAR struct socket *psock,
  ****************************************************************************/
 
 static int bluetooth_bind(FAR struct socket *psock,
-                           FAR const struct sockaddr *addr, socklen_t addrlen)
+                          FAR const struct sockaddr *addr, socklen_t addrlen)
 {
   FAR const struct sockaddr_bt_s *iaddr;
   FAR struct radio_driver_s *radio;
@@ -442,10 +443,10 @@ static int bluetooth_bind(FAR struct socket *psock,
  * Name: bluetooth_getsockname
  *
  * Description:
- *   The bluetooth_getsockname() function retrieves the locally-bound name of the
- *   specified packet socket, stores this address in the sockaddr structure
- *   pointed to by the 'addr' argument, and stores the length of this
- *   address in the object pointed to by the 'addrlen' argument.
+ *   The bluetooth_getsockname() function retrieves the locally-bound name of
+ *   the specified packet socket, stores this address in the sockaddr
+ *   structure pointed to by the 'addr' argument, and stores the length of
+ *   this address in the object pointed to by the 'addrlen' argument.
  *
  *   If the actual length of the address is greater than the length of the
  *   supplied sockaddr structure, the stored address will be truncated.
@@ -504,8 +505,8 @@ static int bluetooth_getsockname(FAR struct socket *psock,
  * Name: bluetooth_getpeername
  *
  * Description:
- *   The bluetooth_getpeername() function retrieves the remote-connected name of
- *   the specified local socket, stores this address in the sockaddr
+ *   The bluetooth_getpeername() function retrieves the remote-connected name
+ *   of the specified local socket, stores this address in the sockaddr
  *   structure pointed to by the 'addr' argument, and stores the length of
  *   this address in the object pointed to by the 'addrlen' argument.
  *
@@ -708,9 +709,10 @@ static ssize_t bluetooth_send(FAR struct socket *psock, FAR const void *buf,
  *
  ****************************************************************************/
 
-static ssize_t bluetooth_sendto(FAR struct socket *psock, FAR const void *buf,
-                                 size_t len, int flags,
-                                 FAR const struct sockaddr *to, socklen_t tolen)
+static ssize_t bluetooth_sendto(FAR struct socket *psock,
+                                FAR const void *buf, size_t len, int flags,
+                                FAR const struct sockaddr *to,
+                                socklen_t tolen)
 {
   ssize_t ret;