From 3a3539f2bee86f821ed59368cc954ad74ab89b95 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 13 Jan 2020 14:26:04 -0600 Subject: [PATCH] net/: Fix some new problems found by the current nxstyle with .c files in the net/ directory. (#92) --- net/igmp/igmp_poll.c | 2 +- net/local/local_fifo.c | 2 +- net/pkt/pkt_conn.c | 16 ++++++++++------ net/route/net_cacheroute.c | 4 ++-- net/route/net_del_fileroute.c | 2 +- net/route/net_del_ramroute.c | 2 +- net/route/net_fileroute.c | 2 +- net/route/net_router.c | 4 ++-- net/route/netdev_router.c | 4 ++-- net/usrsock/usrsock_dev.c | 2 +- 10 files changed, 22 insertions(+), 18 deletions(-) diff --git a/net/igmp/igmp_poll.c b/net/igmp/igmp_poll.c index c1752aba4f..ae6b3830d6 100644 --- a/net/igmp/igmp_poll.c +++ b/net/igmp/igmp_poll.c @@ -58,7 +58,7 @@ #ifdef CONFIG_NET_IGMP /**************************************************************************** - * Private Functions + * Pre-processor Definitions ****************************************************************************/ /* Buffer layout */ diff --git a/net/local/local_fifo.c b/net/local/local_fifo.c index 4165fd7b93..a8822e9d5b 100644 --- a/net/local/local_fifo.c +++ b/net/local/local_fifo.c @@ -54,7 +54,7 @@ #include "local/local.h" /**************************************************************************** - * Private Functions + * Pre-processor Definitions ****************************************************************************/ #define LOCAL_CS_SUFFIX "CS" /* Name of the client-to-server FIFO */ diff --git a/net/pkt/pkt_conn.c b/net/pkt/pkt_conn.c index 8e6f949065..fad97ac852 100644 --- a/net/pkt/pkt_conn.c +++ b/net/pkt/pkt_conn.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/pkt/pkt_conn.c * - * Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016-2017, 2020 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Large parts of this file were leveraged from uIP logic: @@ -58,6 +58,15 @@ #include "devif/devif.h" #include "pkt/pkt.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define eth_addr_cmp(addr1, addr2) \ + ((addr1[0] == addr2[0]) && (addr1[1] == addr2[1]) && \ + (addr1[2] == addr2[2]) && (addr1[3] == addr2[3]) && \ + (addr1[4] == addr2[4]) && (addr1[5] == addr2[5])) + /**************************************************************************** * Private Data ****************************************************************************/ @@ -199,11 +208,6 @@ void pkt_free(FAR struct pkt_conn_s *conn) FAR struct pkt_conn_s *pkt_active(FAR struct eth_hdr_s *buf) { - #define eth_addr_cmp(addr1, addr2) \ - ((addr1[0] == addr2[0]) && (addr1[1] == addr2[1]) && \ - (addr1[2] == addr2[2]) && (addr1[3] == addr2[3]) && \ - (addr1[4] == addr2[4]) && (addr1[5] == addr2[5])) - FAR struct pkt_conn_s *conn = (FAR struct pkt_conn_s *)g_active_pkt_connections.head; diff --git a/net/route/net_cacheroute.c b/net/route/net_cacheroute.c index 77966295db..96d5ad4840 100644 --- a/net/route/net_cacheroute.c +++ b/net/route/net_cacheroute.c @@ -77,7 +77,7 @@ while (0) /**************************************************************************** - * Public Types + * Private Types ****************************************************************************/ #ifdef CONFIG_ROUTE_IPv4_CACHEROUTE @@ -470,7 +470,7 @@ static void net_reset_ipv6_cache(void) #endif /**************************************************************************** - * Public Function Prototypes + * Public Functions ****************************************************************************/ /**************************************************************************** diff --git a/net/route/net_del_fileroute.c b/net/route/net_del_fileroute.c index 12b5a2fe92..750244e23a 100644 --- a/net/route/net_del_fileroute.c +++ b/net/route/net_del_fileroute.c @@ -58,7 +58,7 @@ #if defined(CONFIG_ROUTE_IPv4_FILEROUTE) || defined(CONFIG_ROUTE_IPv6_FILEROUTE) /**************************************************************************** - * Public Types + * Private Types ****************************************************************************/ #ifdef CONFIG_ROUTE_IPv4_FILEROUTE diff --git a/net/route/net_del_ramroute.c b/net/route/net_del_ramroute.c index 1a6d3032bc..38ce547af0 100644 --- a/net/route/net_del_ramroute.c +++ b/net/route/net_del_ramroute.c @@ -53,7 +53,7 @@ #if defined(CONFIG_ROUTE_IPv4_RAMROUTE) || defined(CONFIG_ROUTE_IPv6_RAMROUTE) /**************************************************************************** - * Public Types + * Private Types ****************************************************************************/ #ifdef CONFIG_ROUTE_IPv4_RAMROUTE diff --git a/net/route/net_fileroute.c b/net/route/net_fileroute.c index 2ce41d38a0..13ce42a27a 100644 --- a/net/route/net_fileroute.c +++ b/net/route/net_fileroute.c @@ -56,7 +56,7 @@ #if defined(CONFIG_ROUTE_IPv4_FILEROUTE) || defined(CONFIG_ROUTE_IPv6_FILEROUTE) /**************************************************************************** - * Pre-processor Defintions + * Pre-processor Definitions ****************************************************************************/ /* Special "impossible" PID value used to indicate that there is no holder diff --git a/net/route/net_router.c b/net/route/net_router.c index 090d1c4bc3..fe1dc6b1e7 100644 --- a/net/route/net_router.c +++ b/net/route/net_router.c @@ -54,7 +54,7 @@ #if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) /**************************************************************************** - * Pre-processor defintions + * Pre-processor Definitions ****************************************************************************/ #ifdef CONFIG_ROUTE_IPv6_CACHEROUTE @@ -70,7 +70,7 @@ #endif /**************************************************************************** - * Public Types + * Private Types ****************************************************************************/ #ifdef CONFIG_NET_IPv4 diff --git a/net/route/netdev_router.c b/net/route/netdev_router.c index c735b0e793..0c7697b4e2 100644 --- a/net/route/netdev_router.c +++ b/net/route/netdev_router.c @@ -53,7 +53,7 @@ #if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) /**************************************************************************** - * Pre-processor defintions + * Pre-processor Definitions ****************************************************************************/ #ifdef CONFIG_ROUTE_IPv6_CACHEROUTE @@ -69,7 +69,7 @@ #endif /**************************************************************************** - * Public Types + * Private Types ****************************************************************************/ #ifdef CONFIG_NET_IPv4 diff --git a/net/usrsock/usrsock_dev.c b/net/usrsock/usrsock_dev.c index a6f31badc0..9f1f21bff5 100644 --- a/net/usrsock/usrsock_dev.c +++ b/net/usrsock/usrsock_dev.c @@ -62,7 +62,7 @@ #include "usrsock/usrsock.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ #ifndef CONFIG_NET_USRSOCKDEV_NPOLLWAITERS