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 405cc710befe5f193c88c8f1a17f5464f9e253e5 Author: Jari van Ewijk <jari.vanew...@nxp.com> AuthorDate: Fri Mar 13 14:30:32 2020 +0100 Code style fixes 2 --- include/nuttx/net/net.h | 3 ++- include/sys/socket.h | 53 ++++++++++++++++++++-------------------- libs/libc/net/lib_recvmsg.c | 3 ++- net/bluetooth/bluetooth_sockif.c | 34 ++++++++++++++------------ 4 files changed, 49 insertions(+), 44 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/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;