From 76c87d2f859c2d6c29ab9ef045da083f48aa16d8 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Wed, 22 Jul 2020 17:30:44 +0900 Subject: [PATCH] net/socket: Fix nxstyle issue --- net/socket/getpeername.c | 19 ++++++++++--------- net/socket/getsockname.c | 11 ++++++----- net/socket/recvfrom.c | 20 +++++++++++--------- net/socket/send.c | 3 ++- net/socket/sendto.c | 3 ++- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/net/socket/getpeername.c b/net/socket/getpeername.c index b245e1720b..2b3a308ae7 100644 --- a/net/socket/getpeername.c +++ b/net/socket/getpeername.c @@ -60,10 +60,10 @@ * Name: psock_getpeername * * Description: - * The psock_getpeername() function retrieves the remote-connected name of the - * specified 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 psock_getpeername() function retrieves the remote-connected name of + * the specified 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. @@ -79,8 +79,8 @@ * Returned Value: * On success, 0 is returned, the 'addr' argument points to the address * of the socket, and the 'addrlen' argument points to the length of the - * address. Otherwise, -1 is returned and errno is set to indicate the error. - * Possible errno values that may be returned include: + * address. Otherwise, -1 is returned and errno is set to indicate the + * error. Possible errno values that may be returned include: * * EBADF - The socket argument is not a valid file descriptor. * ENOTSOCK - The socket argument does not refer to a socket. @@ -145,8 +145,8 @@ int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr, * Returned Value: * On success, 0 is returned, the 'addr' argument points to the address * of the socket, and the 'addrlen' argument points to the length of the - * address. Otherwise, -1 is returned and errno is set to indicate the error. - * Possible errno values that may be returned include: + * address. Otherwise, -1 is returned and errno is set to indicate the + * error. Possible errno values that may be returned include: * * EBADF - The socket argument is not a valid file descriptor. * ENOTSOCK - The socket argument does not refer to a socket. @@ -157,7 +157,8 @@ int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr, * ****************************************************************************/ -int getpeername(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen) +int getpeername(int sockfd, FAR struct sockaddr *addr, + FAR socklen_t *addrlen) { FAR struct socket *psock = sockfd_socket(sockfd); int ret; diff --git a/net/socket/getsockname.c b/net/socket/getsockname.c index c151a69194..613e0f67df 100644 --- a/net/socket/getsockname.c +++ b/net/socket/getsockname.c @@ -79,8 +79,8 @@ * Returned Value: * On success, 0 is returned, the 'addr' argument points to the address * of the socket, and the 'addrlen' argument points to the length of the - * address. Otherwise, -1 is returned and errno is set to indicate the error. - * Possible errno values that may be returned include: + * address. Otherwise, -1 is returned and errno is set to indicate the + * error. Possible errno values that may be returned include: * * EBADF - The socket argument is not a valid file descriptor. * ENOTSOCK - The socket argument does not refer to a socket. @@ -139,8 +139,8 @@ int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, * Returned Value: * On success, 0 is returned, the 'addr' argument points to the address * of the socket, and the 'addrlen' argument points to the length of the - * address. Otherwise, -1 is returned and errno is set to indicate the error. - * Possible errno values that may be returned include: + * address. Otherwise, -1 is returned and errno is set to indicate the + * error. Possible errno values that may be returned include: * * EBADF - The socket argument is not a valid file descriptor. * ENOTSOCK - The socket argument does not refer to a socket. @@ -151,7 +151,8 @@ int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, * ****************************************************************************/ -int getsockname(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen) +int getsockname(int sockfd, FAR struct sockaddr *addr, + FAR socklen_t *addrlen) { FAR struct socket *psock = sockfd_socket(sockfd); int ret; diff --git a/net/socket/recvfrom.c b/net/socket/recvfrom.c index 7458361da7..6a01782c0d 100644 --- a/net/socket/recvfrom.c +++ b/net/socket/recvfrom.c @@ -1,7 +1,8 @@ /**************************************************************************** * net/socket/recvfrom.c * - * Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -185,19 +186,20 @@ ssize_t nx_recvfrom(int sockfd, FAR void *buf, size_t len, int flags, * -1 is returned, and errno is set appropriately: * * EAGAIN - * The socket is marked non-blocking and the receive operation would block, - * or a receive timeout had been set and the timeout expired before data - * was received. + * The socket is marked non-blocking and the receive operation would + * block, or a receive timeout had been set and the timeout expired + * before data was received. * EBADF * The argument sockfd is an invalid descriptor. * ECONNREFUSED - * A remote host refused to allow the network connection (typically because - * it is not running the requested service). + * A remote host refused to allow the network connection (typically + * because it is not running the requested service). * EFAULT - * The receive buffer pointer(s) point outside the process's address space. + * The receive buffer pointer(s) point outside the process's address + * space. * EINTR - * The receive was interrupted by delivery of a signal before any data were - * available. + * The receive was interrupted by delivery of a signal before any data + * were available. * EINVAL * Invalid argument passed. * ENOMEM diff --git a/net/socket/send.c b/net/socket/send.c index 8083ce6cc0..66d1e3af31 100644 --- a/net/socket/send.c +++ b/net/socket/send.c @@ -110,7 +110,8 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len, ret = psock->s_sockif->si_send(psock, buf, len, flags); if (ret < 0) { - nerr("ERROR: socket si_send() (or usrsock_sendto()) failed: %d\n", ret); + nerr("ERROR: socket si_send() (or usrsock_sendto()) failed: %d\n", + ret); } return ret; diff --git a/net/socket/sendto.c b/net/socket/sendto.c index bf7e29ae66..9a70cda821 100644 --- a/net/socket/sendto.c +++ b/net/socket/sendto.c @@ -1,7 +1,8 @@ /**************************************************************************** * net/socket/sendto.c * - * Copyright (C) 2007-2009, 2011-2015, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2015, 2017 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without