diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c index 64c433eea63..5474b49607b 100644 --- a/net/arp/arp_send.c +++ b/net/arp/arp_send.c @@ -82,15 +82,15 @@ static void arp_send_terminate(FAR struct arp_send_s *state, int result) { /* Don't allow any further call backs. */ - state->snd_sent = true; - state->snd_result = (int16_t)result; - state->snd_cb->flags = 0; - state->snd_cb->priv = NULL; - state->snd_cb->event = NULL; + state->snd_sent = true; + state->snd_result = (int16_t)result; + state->snd_cb->flags = 0; + state->snd_cb->priv = NULL; + state->snd_cb->event = NULL; - /* Wake up the waiting thread */ + /* Wake up the waiting thread */ - nxsem_post(&state->snd_sem); + nxsem_post(&state->snd_sem); } /**************************************************************************** diff --git a/net/bluetooth/bluetooth_container.c b/net/bluetooth/bluetooth_container.c index 8953e7cf716..ff78734a077 100644 --- a/net/bluetooth/bluetooth_container.c +++ b/net/bluetooth/bluetooth_container.c @@ -167,10 +167,10 @@ FAR struct bluetooth_container_s *bluetooth_container_allocate(void) if (container != NULL) { - /* Zero and tag the allocated meta-data structure. */ + /* Zero and tag the allocated meta-data structure. */ - memset(container, 0, sizeof(struct bluetooth_container_s)); - container->bn_pool = pool; + memset(container, 0, sizeof(struct bluetooth_container_s)); + container->bn_pool = pool; } return container; diff --git a/net/bluetooth/bluetooth_input.c b/net/bluetooth/bluetooth_input.c index ff6a7f05faa..f19a9a88163 100644 --- a/net/bluetooth/bluetooth_input.c +++ b/net/bluetooth/bluetooth_input.c @@ -146,28 +146,28 @@ static int bluetooth_queue_frame(FAR struct bluetooth_conn_s *conn, if (conn->bc_backlog >= CONFIG_NET_BLUETOOTH_BACKLOG) { - DEBUGASSERT(conn->bc_backlog == CONFIG_NET_BLUETOOTH_BACKLOG); + DEBUGASSERT(conn->bc_backlog == CONFIG_NET_BLUETOOTH_BACKLOG); - /* Remove the container from the tail RX input queue. */ + /* Remove the container from the tail RX input queue. */ - container = conn->bc_rxhead; - DEBUGASSERT(container != NULL); - conn->bc_rxhead = container->bn_flink; - container->bn_flink = NULL; + container = conn->bc_rxhead; + DEBUGASSERT(container != NULL); + conn->bc_rxhead = container->bn_flink; + container->bn_flink = NULL; - /* Did the RX queue become empty? */ + /* Did the RX queue become empty? */ - if (conn->bc_rxhead == NULL) - { - conn->bc_rxtail = NULL; - } + if (conn->bc_rxhead == NULL) + { + conn->bc_rxtail = NULL; + } - DEBUGASSERT(container != NULL && container->bn_iob != NULL); + DEBUGASSERT(container != NULL && container->bn_iob != NULL); - /* Free both the IOB and the container */ + /* Free both the IOB and the container */ - iob_free(container->bn_iob); - bluetooth_container_free(container); + iob_free(container->bn_iob); + bluetooth_container_free(container); } else { diff --git a/net/bluetooth/bluetooth_recvfrom.c b/net/bluetooth/bluetooth_recvfrom.c index d7d8bbee6bc..4e3eecdd20b 100644 --- a/net/bluetooth/bluetooth_recvfrom.c +++ b/net/bluetooth/bluetooth_recvfrom.c @@ -163,11 +163,11 @@ static ssize_t bluetooth_recvfrom_rxqueue(FAR struct radio_driver_s *radio, } #if CONFIG_NET_BLUETOOTH_BACKLOG > 0 - /* Decrement the count of frames in the queue. */ + /* Decrement the count of frames in the queue. */ - DEBUGASSERT(conn->bc_backlog > 0); - conn->bc_backlog--; - DEBUGASSERT((int)conn->bc_backlog == bluetooth_count_frames(conn)); + DEBUGASSERT(conn->bc_backlog > 0); + conn->bc_backlog--; + DEBUGASSERT((int)conn->bc_backlog == bluetooth_count_frames(conn)); #endif /* Extract the IOB containing the frame from the container */ diff --git a/net/ieee802154/ieee802154_container.c b/net/ieee802154/ieee802154_container.c index eea7d1d5e37..a3b069d57bd 100644 --- a/net/ieee802154/ieee802154_container.c +++ b/net/ieee802154/ieee802154_container.c @@ -167,10 +167,10 @@ FAR struct ieee802154_container_s *ieee802154_container_allocate(void) if (container != NULL) { - /* Zero and tag the allocated meta-data structure. */ + /* Zero and tag the allocated meta-data structure. */ - memset(container, 0, sizeof(struct ieee802154_container_s)); - container->ic_pool = pool; + memset(container, 0, sizeof(struct ieee802154_container_s)); + container->ic_pool = pool; } return container; diff --git a/net/ieee802154/ieee802154_input.c b/net/ieee802154/ieee802154_input.c index 3207cee9267..1baec513e4e 100644 --- a/net/ieee802154/ieee802154_input.c +++ b/net/ieee802154/ieee802154_input.c @@ -154,8 +154,8 @@ static int ieee802154_queue_frame(FAR struct ieee802154_conn_s *conn, * delete the oldest frame from the head of the RX queue. */ - if (conn->backlog >= CONFIG_NET_IEEE802154_BACKLOG) - { + if (conn->backlog >= CONFIG_NET_IEEE802154_BACKLOG) + { DEBUGASSERT(conn->backlog == CONFIG_NET_IEEE802154_BACKLOG); /* Remove the container from the tail RX input queue. */ @@ -178,15 +178,15 @@ static int ieee802154_queue_frame(FAR struct ieee802154_conn_s *conn, iob_free(container->ic_iob); ieee802154_container_free(container); - } - else - { - /* Increment the count of frames in the queue. */ + } + else + { + /* Increment the count of frames in the queue. */ - conn->backlog++; - } + conn->backlog++; + } - DEBUGASSERT((int)conn->backlog == ieee802154_count_frames(conn)); + DEBUGASSERT((int)conn->backlog == ieee802154_count_frames(conn)); #endif return OK; diff --git a/net/ieee802154/ieee802154_recvfrom.c b/net/ieee802154/ieee802154_recvfrom.c index 99464a73447..e7a780273f6 100644 --- a/net/ieee802154/ieee802154_recvfrom.c +++ b/net/ieee802154/ieee802154_recvfrom.c @@ -161,11 +161,11 @@ static ssize_t ieee802154_recvfrom_rxqueue(FAR struct radio_driver_s *radio, } #if CONFIG_NET_IEEE802154_BACKLOG > 0 - /* Decrement the count of frames in the queue. */ + /* Decrement the count of frames in the queue. */ - DEBUGASSERT(conn->backlog > 0); - conn->backlog--; - DEBUGASSERT((int)conn->backlog == ieee802154_count_frames(conn)); + DEBUGASSERT(conn->backlog > 0); + conn->backlog--; + DEBUGASSERT((int)conn->backlog == ieee802154_count_frames(conn)); #endif /* Extract the IOB containing the frame from the container */ diff --git a/net/inet/inet_close.c b/net/inet/inet_close.c index 38611318053..31c20346d16 100644 --- a/net/inet/inet_close.c +++ b/net/inet/inet_close.c @@ -291,7 +291,7 @@ static inline int tcp_close_disconnect(FAR struct socket *psock) ret = clock_gettime(CLOCK_REALTIME, &abstime); if (ret >= 0) - { + { /* NOTE: s_linger's unit is deciseconds so we don't need to update * abstime.tv_nsec here. */ diff --git a/net/inet/inet_recvfrom.c b/net/inet/inet_recvfrom.c index 29382b763f7..310c5109153 100644 --- a/net/inet/inet_recvfrom.c +++ b/net/inet/inet_recvfrom.c @@ -255,7 +255,7 @@ static inline void inet_tcp_newdata(FAR struct net_driver_s *dev, #else nerr("ERROR: packet data lost (%d bytes)\n", dev->d_len - recvlen); #endif - } + } /* Indicate no data in the buffer */ diff --git a/net/inet/ipv6_getpeername.c b/net/inet/ipv6_getpeername.c index f0685c8fcfd..ab6329c657e 100644 --- a/net/inet/ipv6_getpeername.c +++ b/net/inet/ipv6_getpeername.c @@ -96,8 +96,8 @@ int ipv6_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr, * been implemented. */ - return -ENOSYS; - } + return -ENOSYS; + } /* Verify that the socket has been connected */ diff --git a/net/inet/ipv6_getsockname.c b/net/inet/ipv6_getsockname.c index 05e8fb9c2e7..5fbafa95cd0 100644 --- a/net/inet/ipv6_getsockname.c +++ b/net/inet/ipv6_getsockname.c @@ -97,8 +97,8 @@ int ipv6_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, * been implemented. */ - return -ENOSYS; - } + return -ENOSYS; + } /* Set the port number */ diff --git a/net/ipforward/ipv6_forward.c b/net/ipforward/ipv6_forward.c index 673158f3cf6..382a40af1ba 100644 --- a/net/ipforward/ipv6_forward.c +++ b/net/ipforward/ipv6_forward.c @@ -307,7 +307,7 @@ static int ipv6_packet_conversion(FAR struct net_driver_s *dev, } } - /* The packet was not forwarded (or the HOP limit was exceeded) */ + /* The packet was not forwarded (or the HOP limit was exceeded) */ ipv6_dropstats(ipv6); return ret; diff --git a/net/local/local_sendto.c b/net/local/local_sendto.c index 54ebecd33ed..4ee0914ec25 100644 --- a/net/local/local_sendto.c +++ b/net/local/local_sendto.c @@ -118,9 +118,9 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf, if (tolen < sizeof(sa_family_t) + 2) { - /* EFAULT - An invalid user space address was specified for a parameter */ + /* EFAULT - An invalid user space address was specified for a parameter */ - return -EFAULT; + return -EFAULT; } /* Make sure that half duplex FIFO has been created. diff --git a/net/netdev/netdev_findbyindex.c b/net/netdev/netdev_findbyindex.c index 9b2e3985581..0c39b121943 100644 --- a/net/netdev/netdev_findbyindex.c +++ b/net/netdev/netdev_findbyindex.c @@ -106,7 +106,7 @@ FAR struct net_driver_s *netdev_findbyindex(int ifindex) * registered. */ - if (dev->d_ifindex == ifindex) + if (dev->d_ifindex == ifindex) #else /* NOTE that this option is not a safe way to enumerate network * devices: There could be changes to the list of registered device @@ -165,7 +165,7 @@ int netdev_nextindex(int ifindex) net_unlock(); return ifindex + 1; - } + } } net_unlock(); diff --git a/net/netdev/netdev_ifconf.c b/net/netdev/netdev_ifconf.c index b6e8c248a36..b1cad3f5f40 100644 --- a/net/netdev/netdev_ifconf.c +++ b/net/netdev/netdev_ifconf.c @@ -144,9 +144,9 @@ static int ifconf_ipv4_callback(FAR struct net_driver_s *dev, FAR void *arg) net_ipv4addr_copy(inaddr->sin_addr.s_addr, dev->d_ipaddr); } - /* Increment the size of the buffer in any event */ + /* Increment the size of the buffer in any event */ - ifc->ifc_len += sizeof(struct ifreq); + ifc->ifc_len += sizeof(struct ifreq); } return 0; @@ -221,9 +221,9 @@ static int ifconf_ipv6_callback(FAR struct net_driver_s *dev, FAR void *arg) net_ipv6addr_copy(inaddr->sin6_addr.s6_addr16, dev->d_ipv6addr); } - /* Increment the size of the buffer in any event */ + /* Increment the size of the buffer in any event */ - lifc->lifc_len += sizeof(struct lifreq); + lifc->lifc_len += sizeof(struct lifreq); } return 0; diff --git a/net/netdev/netdev_unregister.c b/net/netdev/netdev_unregister.c index 47e9daa1173..c099b96f0dc 100644 --- a/net/netdev/netdev_unregister.c +++ b/net/netdev/netdev_unregister.c @@ -153,9 +153,9 @@ int netdev_unregister(FAR struct net_driver_s *dev) } else { - /* The entry was at the beginning of the list */ + /* The entry was at the beginning of the list */ - g_netdevices = curr->flink; + g_netdevices = curr->flink; } curr->flink = NULL; diff --git a/net/procfs/net_statistics.c b/net/procfs/net_statistics.c index 022717fbca2..379741810c9 100644 --- a/net/procfs/net_statistics.c +++ b/net/procfs/net_statistics.c @@ -425,10 +425,10 @@ static int netprocfs_retransmissions(FAR struct netprocfs_file_s *netfile) len += snprintf(&netfile->line[len], NET_LINELEN - len, " ----"); #endif #ifdef CONFIG_NET_ICMP - len += snprintf(&netfile->line[len], NET_LINELEN - len, " ----"); + len += snprintf(&netfile->line[len], NET_LINELEN - len, " ----"); #endif #ifdef CONFIG_NET_ICMPv6 - len += snprintf(&netfile->line[len], NET_LINELEN - len, " ----"); + len += snprintf(&netfile->line[len], NET_LINELEN - len, " ----"); #endif len += snprintf(&netfile->line[len], NET_LINELEN - len, "\n"); diff --git a/net/route/net_add_fileroute.c b/net/route/net_add_fileroute.c index 458a09834e2..20673a54a9d 100644 --- a/net/route/net_add_fileroute.c +++ b/net/route/net_add_fileroute.c @@ -90,8 +90,8 @@ int net_addroute_ipv4(in_addr_t target, in_addr_t netmask, in_addr_t router) ret = net_openroute_ipv4(O_WRONLY | O_APPEND | O_CREAT, &fshandle); if (ret < 0) { - nerr("ERROR: Could not open IPv4 routing table: %d\n", ret); - return ret; + nerr("ERROR: Could not open IPv4 routing table: %d\n", ret); + return ret; } /* Then append the new entry to the end of the routing table */ @@ -124,8 +124,8 @@ int net_addroute_ipv6(net_ipv6addr_t target, net_ipv6addr_t netmask, ret = net_openroute_ipv6(O_WRONLY | O_APPEND | O_CREAT, &fshandle); if (ret < 0) { - nerr("ERROR: Could not open IPv6 routing table: %d\n", ret); - return ret; + nerr("ERROR: Could not open IPv6 routing table: %d\n", ret); + return ret; } /* Then append the new entry to the end of the routing table */ diff --git a/net/route/net_cacheroute.c b/net/route/net_cacheroute.c index cf5fac67c56..7cce8ba31d6 100644 --- a/net/route/net_cacheroute.c +++ b/net/route/net_cacheroute.c @@ -161,7 +161,7 @@ static sem_t g_ipv6_cachelock; #endif /**************************************************************************** - * Public Function Prototypes + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/net/route/net_del_fileroute.c b/net/route/net_del_fileroute.c index d5d3450445f..b09227e2364 100644 --- a/net/route/net_del_fileroute.c +++ b/net/route/net_del_fileroute.c @@ -206,8 +206,8 @@ int net_delroute_ipv4(in_addr_t target, in_addr_t netmask) ret = net_lockroute_ipv4(); if (ret < 0) { - nerr("ERROR: net_lockroute_ipv4 failed: %d\n", ret); - return ret; + nerr("ERROR: net_lockroute_ipv4 faled: %d\n", ret); + return ret; } /* Get the size of the routing table (in entries) */ @@ -252,8 +252,8 @@ int net_delroute_ipv4(in_addr_t target, in_addr_t netmask) ret = net_openroute_ipv4(O_RDWR, &fshandle); if (ret < 0) { - nerr("ERROR: Could not open IPv4 routing table: %d\n", ret); - goto errout_with_lock; + nerr("ERROR: Could not open IPv4 routing table: %d\n", ret); + goto errout_with_lock; } #ifdef CONFIG_ROUTE_IPv4_CACHEROUTE @@ -354,8 +354,8 @@ int net_delroute_ipv6(net_ipv6addr_t target, net_ipv6addr_t netmask) ret = net_lockroute_ipv6(); if (ret < 0) { - nerr("ERROR: net_lockroute_ipv6 failed: %d\n", ret); - return ret; + nerr("ERROR: net_lockroute_ipv6 failed: %d\n", ret); + return ret; } /* Get the size of the routing table (in entries) */ diff --git a/net/route/net_fileroute.c b/net/route/net_fileroute.c index 6fcd5bc26f8..d070defb52a 100644 --- a/net/route/net_fileroute.c +++ b/net/route/net_fileroute.c @@ -517,7 +517,7 @@ ssize_t net_writeroute_ipv6(FAR struct file *filep, ntotal = nwritten; break; - } + } ntotal += nwritten; src += nwritten; diff --git a/net/route/net_foreach_fileroute.c b/net/route/net_foreach_fileroute.c index dac025057d7..7f59a335bf5 100644 --- a/net/route/net_foreach_fileroute.c +++ b/net/route/net_foreach_fileroute.c @@ -90,18 +90,18 @@ int net_foreachroute_ipv4(route_handler_ipv4_t handler, FAR void *arg) * the traversal. */ - if (ret == -ENOENT) - { - /* The routing table does not exit.. return successful completion */ + if (ret == -ENOENT) + { + /* The routing table does not exit.. return successful completion */ - ninfo("The IPv4 routing table file does not exist\n"); - return OK; - } + ninfo("The IPv4 routing table file does not exist\n"); + return OK; + } - /* Some other error occurred. */ + /* Some other error occurred. */ - nerr("ERROR: Could not open IPv4 routing table: %d\n", ret); - return ret; + nerr("ERROR: Could not open IPv4 routing table: %d\n", ret); + return ret; } /* Read each entry from the routing table */ @@ -159,18 +159,18 @@ int net_foreachroute_ipv6(route_handler_ipv6_t handler, FAR void *arg) * the traversal. */ - if (ret == -ENOENT) - { - /* The routing table does not exit.. return successful completion */ + if (ret == -ENOENT) + { + /* The routing table does not exit.. return successful completion */ - ninfo("The IPv6 routing table file does not exist\n"); - return OK; - } + ninfo("The IPv6 routing table file does not exist\n"); + return OK; + } - /* Some other error occurred. */ + /* Some other error occurred. */ - nerr("ERROR: Could not open IPv6 routing table: %d\n", ret); - return ret; + nerr("ERROR: Could not open IPv6 routing table: %d\n", ret); + return ret; } /* Read each entry from the routing table */ diff --git a/net/sixlowpan/sixlowpan_framelist.c b/net/sixlowpan/sixlowpan_framelist.c index 2d7ecbe03aa..f88e258206f 100644 --- a/net/sixlowpan/sixlowpan_framelist.c +++ b/net/sixlowpan/sixlowpan_framelist.c @@ -151,40 +151,40 @@ static uint16_t sixlowpan_protosize(FAR const struct ipv6_hdr_s *ipv6hdr, /* Copy the following protocol header, */ - switch (ipv6hdr->proto) - { + switch (ipv6hdr->proto) + { #ifdef CONFIG_NET_TCP - case IP_PROTO_TCP: - { - FAR struct tcp_hdr_s *tcp = - &((FAR struct ipv6tcp_hdr_s *)ipv6hdr)->tcp; + case IP_PROTO_TCP: + { + FAR struct tcp_hdr_s *tcp = + &((FAR struct ipv6tcp_hdr_s *)ipv6hdr)->tcp; - /* The TCP header length is encoded in the top 4 bits of the - * tcpoffset field (in units of 32-bit words). - */ + /* The TCP header length is encoded in the top 4 bits of the + * tcpoffset field (in units of 32-bit words). + */ - protosize = ((uint16_t)tcp->tcpoffset >> 4) << 2; - } - break; + protosize = ((uint16_t)tcp->tcpoffset >> 4) << 2; + } + break; #endif #ifdef CONFIG_NET_UDP - case IP_PROTO_UDP: - protosize = UDP_HDRLEN; - break; + case IP_PROTO_UDP: + protosize = UDP_HDRLEN; + break; #endif #ifdef CONFIG_NET_ICMPv6 - case IP_PROTO_ICMP6: - protosize = ICMPv6_HDRLEN; - break; + case IP_PROTO_ICMP6: + protosize = ICMPv6_HDRLEN; + break; #endif - default: - nwarn("WARNING: Unrecognized proto: %u\n", ipv6hdr->proto); - protosize = 0; - break; - } + default: + nwarn("WARNING: Unrecognized proto: %u\n", ipv6hdr->proto); + protosize = 0; + break; + } return protosize; } @@ -495,8 +495,8 @@ int sixlowpan_queue_frames(FAR struct radio_driver_s *radio, ret = sixlowpan_radio_framelen(radio); if (ret < 0) { - nerr("ERROR: sixlowpan_radio_framelen() failed: %d\n", ret); - return ret; + nerr("ERROR: sixlowpan_radio_framelen() failed: %d\n", ret); + return ret; } /* Limit to the maximum size supported by the IOBs */ @@ -513,8 +513,8 @@ int sixlowpan_queue_frames(FAR struct radio_driver_s *radio, ret -= SIXLOWPAN_MAC_FCSSIZE; if (ret < MAX_MACHDR || ret > UINT16_MAX) { - nerr("ERROR: Invalid frame size: %d\n", ret); - return ret; + nerr("ERROR: Invalid frame size: %d\n", ret); + return ret; } framelen = (uint16_t)ret; diff --git a/net/sixlowpan/sixlowpan_tcpsend.c b/net/sixlowpan/sixlowpan_tcpsend.c index 870d6f93eb6..c4c988d4976 100644 --- a/net/sixlowpan/sixlowpan_tcpsend.c +++ b/net/sixlowpan/sixlowpan_tcpsend.c @@ -457,11 +457,11 @@ static uint16_t tcp_send_eventhandler(FAR struct net_driver_s *dev, DEBUGASSERT(psock != NULL); if (_SS_ISCONNECTED(psock->s_flags)) - { - /* Report the disconnection event to all socket clones */ + { + /* Report the disconnection event to all socket clones */ - tcp_lost_connection(psock, sinfo->s_cb, flags); - } + tcp_lost_connection(psock, sinfo->s_cb, flags); + } /* Report not connected to the sender */ diff --git a/net/socket/net_fstat.c b/net/socket/net_fstat.c index 535f81008cb..0462ae7d48b 100644 --- a/net/socket/net_fstat.c +++ b/net/socket/net_fstat.c @@ -186,5 +186,5 @@ int net_fstat(int sockfd, FAR struct stat *buf) break; } - return ret; + return ret; } diff --git a/net/socket/net_sockets.c b/net/socket/net_sockets.c index 4fc92e29075..e827af0d4b1 100644 --- a/net/socket/net_sockets.c +++ b/net/socket/net_sockets.c @@ -174,10 +174,10 @@ int sockfd_allocate(int minsd) * as the socket descriptor. */ - memset(&list->sl_sockets[i], 0, sizeof(struct socket)); - list->sl_sockets[i].s_crefs = 1; - _net_semgive(list); - return i + __SOCKFD_OFFSET; + memset(&list->sl_sockets[i], 0, sizeof(struct socket)); + list->sl_sockets[i].s_crefs = 1; + _net_semgive(list); + return i + __SOCKFD_OFFSET; } } diff --git a/net/tcp/tcp_accept.c b/net/tcp/tcp_accept.c index 9f4630ac953..602375bd611 100644 --- a/net/tcp/tcp_accept.c +++ b/net/tcp/tcp_accept.c @@ -193,7 +193,7 @@ static int accept_eventhandler(FAR struct tcp_conn_s *listener, listener->accept_private = NULL; listener->accept = NULL; ret = OK; - } + } return ret; } diff --git a/net/tcp/tcp_backlog.c b/net/tcp/tcp_backlog.c index 04f6a8bfea4..28bcb315e66 100644 --- a/net/tcp/tcp_backlog.c +++ b/net/tcp/tcp_backlog.c @@ -179,30 +179,30 @@ int tcp_backlogdestroy(FAR struct tcp_conn_s *conn) if (conn->backlog) { - /* Remove the backlog structure reference from the connection */ + /* Remove the backlog structure reference from the connection */ - blg = conn->backlog; - conn->backlog = NULL; + blg = conn->backlog; + conn->backlog = NULL; - /* Handle any pending connections in the backlog */ + /* Handle any pending connections in the backlog */ - while ((blc = (FAR struct tcp_blcontainer_s *)sq_remfirst(&blg->bl_pending)) != NULL) - { - blconn = blc->bc_conn; - if (blconn) - { - /* REVISIT -- such connections really need to be gracefully closed */ + while ((blc = (FAR struct tcp_blcontainer_s *)sq_remfirst(&blg->bl_pending)) != NULL) + { + blconn = blc->bc_conn; + if (blconn) + { + /* REVISIT -- such connections really need to be gracefully closed */ - blconn->blparent = NULL; - blconn->backlog = NULL; - blconn->crefs = 0; - tcp_free(blconn); - } - } + blconn->blparent = NULL; + blconn->backlog = NULL; + blconn->crefs = 0; + tcp_free(blconn); + } + } - /* Then free the entire backlog structure */ + /* Then free the entire backlog structure */ - kmm_free(blg); + kmm_free(blg); } return OK; diff --git a/net/tcp/tcp_input.c b/net/tcp/tcp_input.c index 1029d5c3d73..08fc96155aa 100644 --- a/net/tcp/tcp_input.c +++ b/net/tcp/tcp_input.c @@ -548,13 +548,13 @@ found: conn->rto = (conn->sa >> 3) + conn->sv; } - /* Set the acknowledged flag. */ + /* Set the acknowledged flag. */ - flags |= TCP_ACKDATA; + flags |= TCP_ACKDATA; - /* Reset the retransmission timer. */ + /* Reset the retransmission timer. */ - conn->timer = conn->rto; + conn->timer = conn->rto; } /* Do different things depending on in what state the connection is. */ diff --git a/net/tcp/tcp_listen.c b/net/tcp/tcp_listen.c index 6b8a497e05d..362eb332115 100644 --- a/net/tcp/tcp_listen.c +++ b/net/tcp/tcp_listen.c @@ -286,7 +286,7 @@ int tcp_accept_connection(FAR struct net_driver_s *dev, if (listener->accept) { - /* Yes.. accept the connection */ + /* Yes.. accept the connection */ ret = listener->accept(listener, conn); } diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index 431322404a8..fe18dfe2196 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -641,9 +641,9 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev, return flags; } - /* Check if we are being asked to retransmit data */ + /* Check if we are being asked to retransmit data */ - else if ((flags & TCP_REXMIT) != 0) + else if ((flags & TCP_REXMIT) != 0) { FAR struct tcp_wrbuffer_s *wrb; FAR sq_entry_t *entry; @@ -872,7 +872,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev, * be set for this write buffer. */ - if (TCP_WBSEQNO(wrb) == (unsigned)-1) + if (TCP_WBSEQNO(wrb) == (unsigned)-1) { TCP_WBSEQNO(wrb) = conn->isn + conn->sent; } diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index a4a3327ecb2..27cc841c10b 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -472,11 +472,11 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev, DEBUGASSERT(psock != NULL); if (_SS_ISCONNECTED(psock->s_flags)) - { - /* Report not connected */ + { + /* Report not connected */ - tcp_lost_connection(psock, pstate->snd_cb, flags); - } + tcp_lost_connection(psock, pstate->snd_cb, flags); + } pstate->snd_sent = -ENOTCONN; goto end_wait; diff --git a/net/tcp/tcp_sendfile.c b/net/tcp/tcp_sendfile.c index d6d45bf31db..eae867a23d7 100644 --- a/net/tcp/tcp_sendfile.c +++ b/net/tcp/tcp_sendfile.c @@ -234,11 +234,11 @@ static uint16_t ack_eventhandler(FAR struct net_driver_s *dev, DEBUGASSERT(psock != NULL); if (_SS_ISCONNECTED(psock->s_flags)) - { - /* Report not connected */ + { + /* Report not connected */ - tcp_lost_connection(psock, pstate->snd_ackcb, flags); - } + tcp_lost_connection(psock, pstate->snd_ackcb, flags); + } /* Report not connected */ @@ -377,11 +377,11 @@ static uint16_t sendfile_eventhandler(FAR struct net_driver_s *dev, DEBUGASSERT(psock != NULL); if (_SS_ISCONNECTED(psock->s_flags)) - { - /* Report not connected */ + { + /* Report not connected */ - tcp_lost_connection(psock, pstate->snd_datacb, flags); - } + tcp_lost_connection(psock, pstate->snd_datacb, flags); + } /* Report not connected */ diff --git a/net/tcp/tcp_seqno.c b/net/tcp/tcp_seqno.c index 042fb7ad55d..58b4c587ad9 100644 --- a/net/tcp/tcp_seqno.c +++ b/net/tcp/tcp_seqno.c @@ -103,11 +103,11 @@ uint32_t tcp_getsequence(FAR uint8_t *seqno) /* Combine the sequence number from network (big-endian) order */ - value = (uint32_t)seqno[0] << 24 | - (uint32_t)seqno[1] << 16 | - (uint32_t)seqno[2] << 8 | - (uint32_t)seqno[3]; - return value; + value = (uint32_t)seqno[0] << 24 | + (uint32_t)seqno[1] << 16 | + (uint32_t)seqno[2] << 8 | + (uint32_t)seqno[3]; + return value; } /**************************************************************************** diff --git a/net/tcp/tcp_timer.c b/net/tcp/tcp_timer.c index 5da238e4110..b38a3877e1d 100644 --- a/net/tcp/tcp_timer.c +++ b/net/tcp/tcp_timer.c @@ -291,7 +291,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn, goto done; } - /* Exponential backoff. */ + /* Exponential backoff. */ conn->timer = TCP_RTO << (conn->nrtx > 4 ? 4: conn->nrtx); (conn->nrtx)++; diff --git a/net/udp/udp_input.c b/net/udp/udp_input.c index dffa4bd5567..09efec12608 100644 --- a/net/udp/udp_input.c +++ b/net/udp/udp_input.c @@ -143,10 +143,10 @@ static int udp_input(FAR struct net_driver_s *dev, unsigned int iplen) chksum = ~udp_ipv4_chksum(dev); } #endif /* CONFIG_NET_IPv6 */ - } + } - if (chksum != 0) - { + if (chksum != 0) + { #ifdef CONFIG_NET_STATISTICS g_netstats.udp.drop++; g_netstats.udp.chkerr++; diff --git a/net/udp/udp_netpoll.c b/net/udp/udp_netpoll.c index d05b63d19fa..f648ad044e7 100644 --- a/net/udp/udp_netpoll.c +++ b/net/udp/udp_netpoll.c @@ -378,7 +378,7 @@ int udp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) fds->revents |= (POLLRDNORM & fds->events); } - if (psock_udp_cansend(psock) >= 0) + if (psock_udp_cansend(psock) >= 0) { /* Normal data may be sent without blocking (at least one byte). */ diff --git a/net/udp/udp_psock_sendto_buffered.c b/net/udp/udp_psock_sendto_buffered.c index c1b200fdda5..0705787db0d 100644 --- a/net/udp/udp_psock_sendto_buffered.c +++ b/net/udp/udp_psock_sendto_buffered.c @@ -190,8 +190,8 @@ static void sendto_writebuffer_release(FAR struct socket *psock, * the write buffer queue. */ - ret = sendto_next_transfer(psock, conn); - } + ret = sendto_next_transfer(psock, conn); + } } while (wrb != NULL && ret < 0); } @@ -864,12 +864,12 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, * write buffer queue. */ - ret = sendto_next_transfer(psock, conn); - if (ret < 0) - { - (void)sq_remlast(&conn->write_q); - goto errout_with_wrb; - } + ret = sendto_next_transfer(psock, conn); + if (ret < 0) + { + (void)sq_remlast(&conn->write_q); + goto errout_with_wrb; + } net_unlock(); } diff --git a/net/udp/udp_psock_sendto_unbuffered.c b/net/udp/udp_psock_sendto_unbuffered.c index 1d15101ab49..da7344db514 100644 --- a/net/udp/udp_psock_sendto_unbuffered.c +++ b/net/udp/udp_psock_sendto_unbuffered.c @@ -246,9 +246,9 @@ static uint16_t sendto_eventhandler(FAR struct net_driver_s *dev, else #endif /* CONFIG_NET_SOCKOPTS */ { - /* No timeout. Just wait for the next polling cycle */ + /* No timeout. Just wait for the next polling cycle */ - return flags; + return flags; } } @@ -507,7 +507,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, nerr("ERROR: udp_find_raddr_device failed\n"); ret = -ENETUNREACH; goto errout_with_lock; - } + } /* Make sure that the device is in the UP state */ diff --git a/net/usrsock/usrsock_conn.c b/net/usrsock/usrsock_conn.c index a80251d5092..ddcb0cf7379 100644 --- a/net/usrsock/usrsock_conn.c +++ b/net/usrsock/usrsock_conn.c @@ -238,7 +238,9 @@ FAR struct usrsock_conn_s *usrsock_active(int16_t usockid) while ((conn = usrsock_nextconn(conn)) != NULL) { if (conn->usockid == usockid) - return conn; + { + return conn; + } } return NULL; diff --git a/net/usrsock/usrsock_poll.c b/net/usrsock/usrsock_poll.c index e6e983bf12c..d59a69da056 100644 --- a/net/usrsock/usrsock_poll.c +++ b/net/usrsock/usrsock_poll.c @@ -81,8 +81,10 @@ static uint16_t poll_event(FAR struct net_driver_s *dev, FAR void *pvconn, DEBUGASSERT(!info || (info->psock && info->fds)); - if (!info) - return flags; + if (info == NULL) + { + return flags; + } if (flags & USRSOCK_EVENT_ABORT) { diff --git a/net/utils/net_ipv6_mask2pref.c b/net/utils/net_ipv6_mask2pref.c index 07230d83c5d..7800900d63e 100644 --- a/net/utils/net_ipv6_mask2pref.c +++ b/net/utils/net_ipv6_mask2pref.c @@ -113,7 +113,7 @@ static uint8_t net_msbits8(uint8_t byval) static inline uint8_t net_msbits16(uint16_t hword) { - uint8_t ones; + uint8_t ones; /* Look at the MS byte of the 16-bit value */