You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/04/12 18:09:46 UTC

[incubator-nuttx] 04/04: Run nxstyle against files modified in previous commit.

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 759d8c1bfaa27283e60020ecca358defe0d8a4ef
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Sun Apr 12 11:18:02 2020 -0600

    Run nxstyle against files modified in previous commit.
---
 drivers/rwbuffer.c                                 |   8 +-
 include/nuttx/net/bluetooth.h                      |   6 +-
 include/nuttx/wireless/ieee802154/ieee802154_mac.h | 192 +++++++++++----------
 libs/libnx/nxfonts/nxfonts_cache.c                 |  30 ++--
 net/icmpv6/icmpv6_notify.c                         |   4 +-
 net/icmpv6/icmpv6_rnotify.c                        |   5 +-
 net/sixlowpan/sixlowpan_internal.h                 |  70 ++++----
 net/sixlowpan/sixlowpan_send.c                     |  21 ++-
 net/sixlowpan/sixlowpan_tcpsend.c                  |  48 +++---
 net/sixlowpan/sixlowpan_udpsend.c                  |  11 +-
 10 files changed, 212 insertions(+), 183 deletions(-)

diff --git a/drivers/rwbuffer.c b/drivers/rwbuffer.c
index 8ab204e..6a88e03 100644
--- a/drivers/rwbuffer.c
+++ b/drivers/rwbuffer.c
@@ -390,7 +390,9 @@ static int rwb_rhreload(FAR struct rwbuffer_s *rwb, off_t startblock)
       rwb->rhnblocks    = nblocks;
       rwb->rhblockstart = startblock;
 
-      /* The return value is not the number of blocks we asked to be loaded. */
+      /* The return value is not the number of blocks we asked to be
+       * loaded.
+       */
 
       return nblocks;
     }
@@ -1003,7 +1005,9 @@ ssize_t rwb_write(FAR struct rwbuffer_s *rwb, off_t startblock,
     {
       finfo("startblock=%d wrbuffer=%p\n", startblock, wrbuffer);
 
-      /* Use the block cache unless the buffer size is bigger than block cache */
+      /* Use the block cache unless the buffer size is bigger than block
+       * cache.
+       */
 
       if (nblocks > rwb->wrmaxblocks)
         {
diff --git a/include/nuttx/net/bluetooth.h b/include/nuttx/net/bluetooth.h
index 7ce61a3..0b9d3bc 100644
--- a/include/nuttx/net/bluetooth.h
+++ b/include/nuttx/net/bluetooth.h
@@ -22,7 +22,7 @@
 #define __INCLUDE_NUTTX_NET_BLUETOOTH_H
 
 /****************************************************************************
- * Public Function Prototypes
+ * Included Files
  ****************************************************************************/
 
 #include <nuttx/config.h>
@@ -32,10 +32,6 @@
 #ifdef CONFIG_NET_BLUETOOTH
 
 /****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
diff --git a/include/nuttx/wireless/ieee802154/ieee802154_mac.h b/include/nuttx/wireless/ieee802154/ieee802154_mac.h
index c137803..6b49cb7 100644
--- a/include/nuttx/wireless/ieee802154/ieee802154_mac.h
+++ b/include/nuttx/wireless/ieee802154/ieee802154_mac.h
@@ -1,4 +1,4 @@
-/****************************************************************************
+/*****************************************************************************
  * include/nuttx/wireless/ieee802154/ieee802154_mac.h
  *
  *   Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
@@ -37,14 +37,14 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- ****************************************************************************/
+ *****************************************************************************/
 
 #ifndef __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_MAC_H
 #define __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_MAC_H
 
-/****************************************************************************
+/*****************************************************************************
  * Included Files
- ****************************************************************************/
+ *****************************************************************************/
 
 #include <nuttx/config.h>
 
@@ -59,11 +59,11 @@
 
 #include <nuttx/fs/ioctl.h>
 
-/****************************************************************************
+/*****************************************************************************
  * Pre-Processor Definitions
- ****************************************************************************/
+ *****************************************************************************/
 
-/* Configuration ************************************************************/
+/* Configuration *************************************************************/
 
 #if !defined(CONFIG_MAC802154_NPANDESC) || CONFIG_MAC802154_NPANDESC <= 0
 #  undef CONFIG_MAC802154_NPANDESC
@@ -104,13 +104,12 @@
 
 /* Some addresses */
 
-#define IEEE802154_PANID_UNSPEC ((uint8_t[]){0xFF,0xFF})
-#define IEEE802154_SADDR_UNSPEC ((uint8_t[]){0xFF,0xFF})
-#define IEEE802154_SADDR_BCAST  ((uint8_t[]){0xFE,0xFF})
-#define IEEE802154_EADDR_UNSPEC ((uint8_t[]){0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF})
-
+#define IEEE802154_PANID_UNSPEC ((uint8_t[]){0xff,0xff})
+#define IEEE802154_SADDR_UNSPEC ((uint8_t[]){0xff,0xff})
+#define IEEE802154_SADDR_BCAST  ((uint8_t[]){0xfe,0xff})
+#define IEEE802154_EADDR_UNSPEC ((uint8_t[]){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff})
 
-/* IEEE 802.15.4 MAC Character Driver IOCTL Commands ************************/
+/* IEEE 802.15.4 MAC Character Driver IOCTL Commands *************************/
 
 /* The IEEE 802.15.4 standard specifies a MLME Service Access Point (SAP)
  * including a series of primitives that are used as an interface between
@@ -139,20 +138,20 @@
 #define MAC802154IOC_MLME_RXENABLE_REQUEST     _MAC802154IOC(0x0007)
 #define MAC802154IOC_MLME_SCAN_REQUEST         _MAC802154IOC(0x0008)
 #define MAC802154IOC_MLME_SET_REQUEST          _MAC802154IOC(0x0009)
-#define MAC802154IOC_MLME_START_REQUEST        _MAC802154IOC(0x000A)
-#define MAC802154IOC_MLME_SYNC_REQUEST         _MAC802154IOC(0x000B)
-#define MAC802154IOC_MLME_POLL_REQUEST         _MAC802154IOC(0x000C)
-#define MAC802154IOC_MLME_DPS_REQUEST          _MAC802154IOC(0x000D)
-#define MAC802154IOC_MLME_SOUNDING_REQUEST     _MAC802154IOC(0x000E)
-#define MAC802154IOC_MLME_CALIBRATE_REQUEST    _MAC802154IOC(0x000F)
+#define MAC802154IOC_MLME_START_REQUEST        _MAC802154IOC(0x000a)
+#define MAC802154IOC_MLME_SYNC_REQUEST         _MAC802154IOC(0x000b)
+#define MAC802154IOC_MLME_POLL_REQUEST         _MAC802154IOC(0x000c)
+#define MAC802154IOC_MLME_DPS_REQUEST          _MAC802154IOC(0x000d)
+#define MAC802154IOC_MLME_SOUNDING_REQUEST     _MAC802154IOC(0x000e)
+#define MAC802154IOC_MLME_CALIBRATE_REQUEST    _MAC802154IOC(0x000f)
 
 /* Non-standard MAC ioctl calls */
 
-#define MAC802154IOC_NOTIFY_REGISTER           _MAC802154IOC(0x00FD)
-#define MAC802154IOC_GET_EVENT                 _MAC802154IOC(0x00FE)
-#define MAC802154IOC_ENABLE_EVENTS             _MAC802154IOC(0x00FF)
+#define MAC802154IOC_NOTIFY_REGISTER           _MAC802154IOC(0x00fd)
+#define MAC802154IOC_GET_EVENT                 _MAC802154IOC(0x00fe)
+#define MAC802154IOC_ENABLE_EVENTS             _MAC802154IOC(0x00ff)
 
-/* IEEE 802.15.4 MAC Interface **********************************************/
+/* IEEE 802.15.4 MAC Interface ***********************************************/
 
 /* Frame control field masks, 2 bytes
  * Seee IEEE 802.15.4/2011 5.2.1.1 page 57
@@ -163,9 +162,9 @@
 #define IEEE802154_FRAMECTRL_PEND       0x0010  /* Frame pending, bit 4 */
 #define IEEE802154_FRAMECTRL_ACKREQ     0x0020  /* Acknowledge request, bit 5 */
 #define IEEE802154_FRAMECTRL_PANIDCOMP  0x0040  /* PAN ID Compression, bit 6 */
-#define IEEE802154_FRAMECTRL_DADDR      0x0C00  /* Dest addressing mode, bits 10-11 */
+#define IEEE802154_FRAMECTRL_DADDR      0x0c00  /* Dest addressing mode, bits 10-11 */
 #define IEEE802154_FRAMECTRL_VERSION    0x3000  /* Source addressing mode, bits 12-13 */
-#define IEEE802154_FRAMECTRL_SADDR      0xC000  /* Source addressing mode, bits 14-15 */
+#define IEEE802154_FRAMECTRL_SADDR      0xc000  /* Source addressing mode, bits 14-15 */
 
 #define IEEE802154_FRAMECTRL_SHIFT_FTYPE      0  /* Frame type, bits 0-2 */
 #define IEEE802154_FRAMECTRL_SHIFT_SEC        3  /* Security Enabled, bit 3 */
@@ -180,9 +179,9 @@
  * Seee IEEE 802.15.4/2011 5.2.2.1.2 page 62
  */
 
-#define IEEE802154_SFSPEC_BEACONORDER 0x000F  /* Beacon order, bits 0-3 */
-#define IEEE802154_SFSPEC_SFORDER     0x00F0  /* Superframe Order, bit 4-7 */
-#define IEEE802154_SFSPEC_FINCAPSLOT  0x0F00  /* Final CAP Slot, bit 8-11 */
+#define IEEE802154_SFSPEC_BEACONORDER 0x000f  /* Beacon order, bits 0-3 */
+#define IEEE802154_SFSPEC_SFORDER     0x00f0  /* Superframe Order, bit 4-7 */
+#define IEEE802154_SFSPEC_FINCAPSLOT  0x0f00  /* Final CAP Slot, bit 8-11 */
 #define IEEE802154_SFSPEC_BLE         0x1000  /* Battery Life Ext, bit 12 */
 #define IEEE802154_SFSPEC_PANCOORD    0x4000  /* PAN Coordinator, bit 14 */
 #define IEEE802154_SFSPEC_ASSOCPERMIT 0x8000  /* Association Permit, bit 15 */
@@ -208,7 +207,7 @@
  * Seee IEEE 802.15.4/2011 5.2.2.1.3 page 63
  */
 
-#define IEEE802154_GTSDIR_MASK  0x7F /* GTS Directions Mask, bits 0-6 */
+#define IEEE802154_GTSDIR_MASK  0x7f /* GTS Directions Mask, bits 0-6 */
 
 #define IEEE802154_GTSDIR_SHIFT_MASK  0 /* GTS Directions Mask, bits 0-6 */
 
@@ -240,7 +239,7 @@
 /* IEEE 802.15.4 PHY constants */
 
 #define IEEE802154_MAX_PHY_PACKET_SIZE        127
-#define IEEE802154_TURN_AROUND_TIME           12 /*symbol periods*/
+#define IEEE802154_TURN_AROUND_TIME           12 /* symbol periods*/
 
 /* IEEE 802.15.4 MAC constants */
 
@@ -280,9 +279,9 @@
 
 #define MAX_ORPHAN_ADDR   32  /* REVISIT */
 
-/****************************************************************************
+/*****************************************************************************
  * Public Types
- ****************************************************************************/
+ *****************************************************************************/
 
 /* IEEE 802.15.4 MAC status codes */
 
@@ -458,7 +457,7 @@ enum ieee802154_attr_e
   IEEE802154_ATTR_MAC_PANCOORD_EXT_ADDR,
   IEEE802154_ATTR_MAC_PANCOORD_SHORT_ADDR,
 
-  /* Non-standard MAC Attributes*/
+  /* Non-standard MAC Attributes */
 
   IEEE802154_ATTR_MAC_DEVMODE,
 };
@@ -474,6 +473,7 @@ enum ieee802154_frametype_e
 };
 
 /* MAC command IDs */
+
 /* TODO: Change terminology to be "current primitive" */
 
 enum ieee802154_cmdid_e
@@ -596,7 +596,7 @@ struct ieee802154_pandesc_s
 
   struct ieee802154_addr_s coordaddr;
 
-  uint8_t chan;  /* current channel occupied by the network */
+  uint8_t chan;   /* current channel occupied by the network */
   uint8_t chpage; /* current channel page occupied by the network */
 
   /* The superframe specifications received in the beacon frame */
@@ -682,6 +682,7 @@ union ieee802154_phyattr_u
   int32_t   txpwr;
   uint32_t  symdur_picosec;
   uint8_t   fcslen;
+
   /* TODO: Fill this out as we implement supported get/set commands */
 };
 
@@ -896,7 +897,8 @@ struct ieee802154_data_ind_s
  * Primitive: MCPS-PURGE.request
  *
  * Description:
- *    Allows the next higher layer to purge an MSDU from the transaction queue.
+ *   Allows the next higher layer to purge an MSDU from the transaction
+ *   queue.
  *
  *****************************************************************************/
 
@@ -923,17 +925,18 @@ struct ieee802154_assoc_req_s
 
   FAR struct ieee802154_primitive_s *flink;
 
-  uint8_t chan;  /* Channel number to attempt association */
+  uint8_t chan;   /* Channel number to attempt association */
   uint8_t chpage; /* Channel page to attempt association */
 
   /* TODO:
    * This is a non-standard field. I believe there is a catch 22 in the
-   * standard and until I can figure it out, I'm adding this boolean to let the
-   * application tell the MAC whether it is trying to assocaite with a beacon
-   * enabled PAN or non-beacon enabled PAN. If it is beacon-enabled, the MAC
-   * will track the beacon first before transmitting the association. This can
-   * take some time depending on the beacon interval. If the PAN is non-beacon
-   * enabled, the association request is sent immediately via CSMA.
+   * standard and until I can figure it out, I'm adding this boolean to let
+   * the application tell the MAC whether it is trying to associate with a
+   * beacon enabled PAN or non-beacon enabled PAN. If it is beacon-enabled,
+   * the MAC will track the beacon first before transmitting the
+   * association.  This can take some time depending on the beacon interval.
+   * If the PAN is non-beacon enabled, the association request is sent
+   * immediately via CSMA.
    *
    * The catch 22: The standard outlines the procedure for associating: reset
    * the MAC, scan to find PAN's and pass coordinator address info to
@@ -1018,7 +1021,7 @@ struct ieee802154_assoc_resp_s
 
   uint8_t devaddr[IEEE802154_EADDRSIZE];
 
-  /* Address assigned to the device. 0xFFFF if failure */
+  /* Address assigned to the device. 0xffff if failure */
 
   uint8_t assocsaddr[IEEE802154_SADDRSIZE];
 
@@ -1037,8 +1040,8 @@ struct ieee802154_assoc_resp_s
  * Primitive: MLME-ASSOCIATE.confirm
  *
  * Description:
- *    Used to inform the next higher layer of the initiating device whether its
- *    request to associate was successful or unsuccessful.
+ *   Used to inform the next higher layer of the initiating device whether
+ *   its request to associate was successful or unsuccessful.
  *
  *****************************************************************************/
 
@@ -1155,11 +1158,11 @@ struct ieee802154_disassoc_conf_s
  * Primitive: MLME-BEACONNOTIFY.indication
  *
  * Description:
- *    Used to send parameters contained within a beacon frame received by the
- *    MAC sublayer to the next higher layer when either macAutoRequest is set to
- *    FALSE or when the beacon frame contains one or more octets of payload. The
- *    primitive also sends a measure of the LQI and the time the beacon frame
- *    was received.
+ *   Used to send parameters contained within a beacon frame received by
+ *   the MAC sublayer to the next higher layer when either macAutoRequest is
+ *   set to FALSE or when the beacon frame contains one or more octets of
+ *   payload.  The primitive also sends a measure of the LQI and the time the
+ *   beacon frame was received.
  *
  *****************************************************************************/
 
@@ -1211,9 +1214,9 @@ struct ieee802154_commstatus_ind_s
  * Primitive: MLME-GTS.request
  *
  * Description:
- *    Allows a device to send a request to the PAN coordinator to allocate a new
- *    GTS or to deallocate an existing GTS. This primitive is also used by the
- *    PAN coordinator to initiate a GTS deallocation.
+ *   Allows a device to send a request to the PAN coordinator to allocate a
+ *   new GTS or to deallocate an existing GTS. This primitive is also used
+ *   by the PAN coordinator to initiate a GTS deallocation.
  *
  *****************************************************************************/
 
@@ -1236,8 +1239,8 @@ struct ieee802154_gts_req_s
  * Primitive: MLME-GTS.confirm
  *
  * Description:
- *    Reports the results of a request to allocate a new GTS or to deallocate an
- *    existing GTS.
+ *    Reports the results of a request to allocate a new GTS or to deallocate
+ *    an existing GTS.
  *
  *****************************************************************************/
 
@@ -1280,8 +1283,8 @@ struct ieee802154_gts_ind_s
  * Primitive: MLME-ORPHAN.indication
  *
  * Description:
- *    Generated by the MLME of a coordinator and issued to its next higher layer
- *    on receipt of an orphan notification command.
+ *    Generated by the MLME of a coordinator and issued to its next higher
+ *    layer on receipt of an orphan notification command.
  *
  *****************************************************************************/
 
@@ -1468,10 +1471,10 @@ struct ieee802154_get_req_s
  *    Attempts to write the given value to the indicated PIB attribute.
  *
  *  NOTE: The standard specifies that confirmation should be indicated via
- *  the asynchronous MLME-SET.confirm primitive.  However, in our implementation
- *  there is no reason not to synchronously return the status immediately.
- *  Therefore, we do merge the functionality of the MLME-SET.request and
- *  MLME-SET.confirm primitives together.
+ *  the asynchronous MLME-SET.confirm primitive.  However, in our
+ *  implementation there is no reason not to synchronously return the status
+ *  immediately.  Therefore, we do merge the functionality of the
+ *  MLME-SET.request and MLME-SET.confirm primitives together.
  *
  *****************************************************************************/
 
@@ -1489,9 +1492,9 @@ struct ieee802154_set_req_s
  * Primitive: MLME-START.request
  *
  * Description:
- *    Used by the PAN coordinator to initiate a new PAN or to begin using a new
- *    superframe configuration. This primitive is also used by a device already
- *    associated with an existing PAN to begin using a new superframe
+ *    Used by the PAN coordinator to initiate a new PAN or to begin using a
+ *    new superframe configuration. This primitive is also used by a device
+ *    already associated with an existing PAN to begin using a new superframe
  *    configuration.
  *
  *****************************************************************************/
@@ -1689,9 +1692,9 @@ union ieee802154_primitive_u
 struct ieee802154_primitive_s
 {
   /* Must be first member so that we can interchange between the actual
-   * primitive and this extended struct. Note, all frames also have the first
-   * entry as a forward link to a primitive so that primitives can be contained
-   * in lists.
+   * primitive and this extended struct. Note, all frames also have the
+   * first entry as a forward link to a primitive so that primitives can be
+   * contained in lists.
    */
 
   union ieee802154_primitive_u u;
@@ -1718,9 +1721,9 @@ union ieee802154_macarg_u
   struct ieee802154_start_req_s    startreq;    /* MAC802154IOC_MLME_START_REQUEST */
   struct ieee802154_sync_req_s     syncreq;     /* MAC802154IOC_MLME_SYNC_REQUEST */
   struct ieee802154_poll_req_s     pollreq;     /* MAC802154IOC_MLME_POLL_REQUEST */
-  /* To be determined */                        /* MAC802154IOC_MLME_DPS_REQUEST */
-  /* To be determined */                        /* MAC802154IOC_MLME_SOUNDING_REQUEST */
-  /* To be determined */                        /* MAC802154IOC_MLME_CALIBRATE_REQUEST */
+                                                /* MAC802154IOC_MLME_DPS_REQUEST */
+                                                /* MAC802154IOC_MLME_SOUNDING_REQUEST */
+                                                /* MAC802154IOC_MLME_CALIBRATE_REQUEST */
 
   struct sigevent                  event;       /* MAC802154IOC_NOTIFY_REGISTER */
   struct ieee802154_primitive_s    primitive;   /* MAC802154IOC_GET_EVENT */
@@ -1755,13 +1758,13 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
+/*****************************************************************************
  * Public Function Prototypes
- ****************************************************************************/
+ *****************************************************************************/
 
 struct ieee802154_radio_s; /* Forward reference */
 
-/****************************************************************************
+/*****************************************************************************
  * Name: mac802154_create
  *
  * Description:
@@ -1783,11 +1786,11 @@ struct ieee802154_radio_s; /* Forward reference */
  * Returned Value:
  *   An opaque reference to the MAC state data.
  *
- ****************************************************************************/
+ *****************************************************************************/
 
 MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev);
 
-/****************************************************************************
+/*****************************************************************************
  * Name: mac802154dev_register
  *
  * Description:
@@ -1803,11 +1806,11 @@ MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev);
  *   Zero (OK) is returned on success.  Otherwise a negated errno value is
  *   returned to indicate the nature of the failure.
  *
- ****************************************************************************/
+ *****************************************************************************/
 
 int mac802154dev_register(MACHANDLE mac, int minor);
 
-/****************************************************************************
+/*****************************************************************************
  * Name: mac802154netdev_register
  *
  * Description:
@@ -1821,19 +1824,19 @@ int mac802154dev_register(MACHANDLE mac, int minor);
  *   Zero (OK) is returned on success.  Otherwise a negated errno value is
  *   returned to indicate the nature of the failure.
  *
- ****************************************************************************/
+ *****************************************************************************/
 
 int mac802154netdev_register(MACHANDLE mac);
 
-/****************************************************************************
+/*****************************************************************************
  * Name: ieee802154_primitivepool_initialize
  *
  * Description:
- *   This function initializes the primitive allocator. Primitives are defined
- *   in the standard and are used to pass information between the MAC layer and
- *   the next highest layer. They are a data type abstraction.  This function must
- *   be called early in the initialization sequence before any radios
- *   begin operation.
+ *   This function initializes the primitive allocator. Primitives are
+ *   defined in the standard and are used to pass information between the
+ *   MAC layer and the next highest layer. They are a data type abstraction.
+ *   This function must be called early in the initialization sequence
+ *   before any radios begin operation.
  *
  * Input Parameters:
  *   None
@@ -1841,11 +1844,11 @@ int mac802154netdev_register(MACHANDLE mac);
  * Returned Value:
  *   None
  *
- ****************************************************************************/
+ *****************************************************************************/
 
 void ieee802154_primitivepool_initialize(void);
 
-/****************************************************************************
+/*****************************************************************************
  * Name: ieee802154_primitive_allocate
  *
  * Description:
@@ -1865,21 +1868,22 @@ void ieee802154_primitivepool_initialize(void);
  *   None
  *
  * Returned Value:
- *   A reference to the allocated primitive structure.  All user fields in this
- *   structure have been zeroed.  On a failure to allocate, NULL is
+ *   A reference to the allocated primitive structure.  All user fields in
+ *   this structure have been zeroed.  On a failure to allocate, NULL is
  *   returned.
  *
- ****************************************************************************/
+ *****************************************************************************/
 
 FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void);
 
-/****************************************************************************
+/*****************************************************************************
  * Name: ieee802154_primitive_free
  *
  * Description:
- *   The ieee802154_primitive_free function will return a primitive structure to
- *   the free pool if it was a pre-allocated primitive structure. If the primitive
- *   was allocated dynamically it will be deallocated.
+ *   The ieee802154_primitive_free function will return a primitive
+ *   structure to the free pool if it was a pre-allocated primitive
+ *   structure. If the primitive was allocated dynamically it will be
+ *   deallocated.
  *
  * Input Parameters:
  *   prim - primitive structure to free
@@ -1887,7 +1891,7 @@ FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void);
  * Returned Value:
  *   None
  *
- ****************************************************************************/
+ *****************************************************************************/
 
 void ieee802154_primitive_free(FAR struct ieee802154_primitive_s *prim);
 
diff --git a/libs/libnx/nxfonts/nxfonts_cache.c b/libs/libnx/nxfonts/nxfonts_cache.c
index c2ad01a..316a7e0 100644
--- a/libs/libnx/nxfonts/nxfonts_cache.c
+++ b/libs/libnx/nxfonts/nxfonts_cache.c
@@ -282,9 +282,9 @@ static FAR struct nxfonts_glyph_s *
 
   /* Try to find the glyph in the list of pre-rendered glyphs */
 
-   for (prev = NULL, glyph = priv->head;
-        glyph != NULL;
-        prev = glyph, glyph = glyph->flink)
+  for (prev = NULL, glyph = priv->head;
+       glyph != NULL;
+       prev = glyph, glyph = glyph->flink)
     {
       /* Check if we found the glyph for this character */
 
@@ -433,9 +433,12 @@ static inline void nxf_fillglyph(FAR struct nxfonts_fcache_s *priv,
 
       /* Get two 32-bit values for alternating 32 representations */
 
-      pixel[0] = (uint32_t)priv->bgcolor <<  8 | (uint32_t)priv->bgcolor >> 16;
-      pixel[1] = (uint32_t)priv->bgcolor << 16 | (uint32_t)priv->bgcolor >> 8;
-      pixel[2] = (uint32_t)priv->bgcolor << 24 | (uint32_t)priv->bgcolor;
+      pixel[0] = (uint32_t)priv->bgcolor <<  8 |
+                 (uint32_t)priv->bgcolor >> 16;
+      pixel[1] = (uint32_t)priv->bgcolor << 16 |
+                 (uint32_t)priv->bgcolor >> 8;
+      pixel[2] = (uint32_t)priv->bgcolor << 24 |
+                 (uint32_t)priv->bgcolor;
 
       for (row = 0; row < glyph->height; row++)
         {
@@ -532,7 +535,9 @@ static inline FAR struct nxfonts_glyph_s *
 
   if (glyph != NULL)
     {
-      /* Save the character code, dimensions, and physical width of the glyph */
+      /* Save the character code, dimensions, and physical width of the
+       * glyph.
+       */
 
       glyph->code   = ch;
       glyph->width  = width;
@@ -660,7 +665,7 @@ FCACHE nxf_cache_connect(enum nx_fontid_e fontid,
       /* Allocate memory for the (empty) font cache */
 
       priv = (FAR struct nxfonts_fcache_s *)
-        lib_zalloc(sizeof( struct nxfonts_fcache_s));
+        lib_zalloc(sizeof(struct nxfonts_fcache_s));
 
       if (priv == NULL)
         {
@@ -784,7 +789,8 @@ errout_with_lock:
  *   font handle is invalid upon return in either case.
  *
  * Input Parameters:
- *   fhandle - A font cache handle previously returned by nxf_cache_connect();
+ *   fhandle - A font cache handle previously returned by
+ *             nxf_cache_connect();
  *
  * Returned Value:
  *   None
@@ -864,7 +870,8 @@ void nxf_cache_disconnect(FCACHE fhandle)
  *   cache.
  *
  * Input Parameters:
- *   fhandle - A font cache handle previously returned by nxf_cache_connect();
+ *   fhandle - A font cache handle previously returned by
+ *             nxf_cache_connect();
  *
  * Returned Value:
  *   Zero (OK) is returned if the metrics were
@@ -896,7 +903,8 @@ NXHANDLE nxf_cache_getfonthandle(FCACHE fhandle)
  *
  ****************************************************************************/
 
-FAR const struct nxfonts_glyph_s *nxf_cache_getglyph(FCACHE fhandle, uint8_t ch)
+FAR const struct nxfonts_glyph_s *
+  nxf_cache_getglyph(FCACHE fhandle, uint8_t ch)
 {
   FAR struct nxfonts_fcache_s *priv = (FAR struct nxfonts_fcache_s *)fhandle;
   FAR struct nxfonts_glyph_s *glyph;
diff --git a/net/icmpv6/icmpv6_notify.c b/net/icmpv6/icmpv6_notify.c
index b131965..d38d039 100644
--- a/net/icmpv6/icmpv6_notify.c
+++ b/net/icmpv6/icmpv6_notify.c
@@ -70,8 +70,8 @@ static struct icmpv6_notify_s *g_icmpv6_waiters;
  *   is sent so that there is no race condition when icmpv6_wait() is called.
  *
  * Assumptions:
- *   This function is called from icmpv6_neighbor() and executes in the normal
- *   tasking environment.
+ *   This function is called from icmpv6_neighbor() and executes in the
+ *   normal tasking environment.
  *
  ****************************************************************************/
 
diff --git a/net/icmpv6/icmpv6_rnotify.c b/net/icmpv6/icmpv6_rnotify.c
index 9172b7b..8a9d1ca 100644
--- a/net/icmpv6/icmpv6_rnotify.c
+++ b/net/icmpv6/icmpv6_rnotify.c
@@ -286,8 +286,9 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify, unsigned int timeout)
  *
  ****************************************************************************/
 
-void icmpv6_rnotify(FAR struct net_driver_s *dev, const net_ipv6addr_t draddr,
-                    const net_ipv6addr_t prefix, unsigned int preflen)
+void icmpv6_rnotify(FAR struct net_driver_s *dev,
+                    const net_ipv6addr_t draddr, const net_ipv6addr_t prefix,
+                    unsigned int preflen)
 {
   FAR struct icmpv6_rnotify_s *curr;
 
diff --git a/net/sixlowpan/sixlowpan_internal.h b/net/sixlowpan/sixlowpan_internal.h
index edbb90e..f250ebe 100644
--- a/net/sixlowpan/sixlowpan_internal.h
+++ b/net/sixlowpan/sixlowpan_internal.h
@@ -25,7 +25,8 @@
  *    All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
@@ -37,17 +38,18 @@
  *    contributors may be used to endorse or promote products derived
  *    from this software without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
  ****************************************************************************/
 
 #ifndef _NET_SIXLOWPAN_SIXLOWPAN_INTERNAL_H
@@ -194,8 +196,8 @@ struct ieee802_txmetadata_s
 };
 #endif
 
-/* This structure holds the packet metadata as a union when multiple different
- * radio type are supported.
+/* This structure holds the packet metadata as a union when multiple
+ * different radio types are supported.
  */
 
 union sixlowpan_metadata_u
@@ -251,9 +253,9 @@ struct iob_s;               /* Forward reference */
  * Name: sixlowpan_send
  *
  * Description:
- *   Process an outgoing UDP or ICMPv6 packet.  Takes an IP packet and formats
- *   it to be sent on an 802.15.4 network using 6lowpan.  Called from common
- *   UDP/ICMPv6 send logic.
+ *   Process an outgoing UDP or ICMPv6 packet.  Takes an IP packet and
+ *   formats it to be sent on an 802.15.4 network using 6lowpan.  Called
+ *   from common UDP/ICMPv6 send logic.
  *
  *   The payload data is in the caller 'buf' and is of length 'buflen'.
  *   Compressed headers will be added and if necessary the packet is
@@ -398,12 +400,12 @@ int sixlowpan_queue_frames(FAR struct radio_driver_s *radio,
  * Name: sixlowpan_hc06_initialize
  *
  * Description:
- *   sixlowpan_hc06_initialize() is called during OS initialization at power-up
- *   reset.  It is called from the common sixlowpan_initialize() function.
- *   sixlowpan_hc06_initialize() configures HC06 networking data structures.
- *   It is called prior to platform-specific driver initialization so that
- *   the 6LoWPAN networking subsystem is prepared to deal with network
- *   driver initialization actions.
+ *   sixlowpan_hc06_initialize() is called during OS initialization at
+ *   power-up reset.  It is called from the common sixlowpan_initialize()
+ *   function.  sixlowpan_hc06_initialize() configures HC06 networking data
+ *   structures.  It is called prior to platform-specific driver
+ *   initialization so that the 6LoWPAN networking subsystem is prepared to
+ *   deal with network driver initialization actions.
  *
  * Input Parameters:
  *   None
@@ -571,10 +573,10 @@ int sixlowpan_uncompresshdr_hc1(FAR struct radio_driver_s *radio,
  *
  * Description:
  *   sixlowpan_nexthopaddr(): If the destination is on-link, extract the
- *   IEEE 802.15.14 destination address from the destination IP address. If the
- *   destination is not reachable directly, use the routing table (if available)
- *   or fall back to the default router IP address and use the router IP address
- *   to derive the IEEE 802.15.4 MAC address.
+ *   IEEE 802.15.14 destination address from the destination IP address.  If
+ *   the destination is not reachable directly, use the routing table (if
+ *   available) or fall back to the default router IP address and use the
+ *   router IP address to derive the IEEE 802.15.4 MAC address.
  *
  ****************************************************************************/
 
@@ -601,15 +603,17 @@ int sixlowpan_nexthopaddr(FAR struct radio_driver_s *radio,
  *   (eaddr).
  *
  *   sixlowpan_islinklocal() and sixlowpan_ismacbased() will return true for
- *   address created in this fashion.  sixlowpan_destaddrfromip() is intended to
- *   handle a tagged address or any size.  Local addresses are of a fixed but
- *   configurable size and sixlowpan_isaddrbased() is for use with such local
- *   addresses.
+ *   address created in this fashion.  sixlowpan_destaddrfromip() is
+ *   intended to handle a tagged address or any size.  Local addresses are
+ *   of a fixed but configurable size and sixlowpan_isaddrbased() is for use
+ *   with such local addresses.
  *
  *    128  112  96   80    64   48   32   16
  *    ---- ---- ---- ----  ---- ---- ---- ----
- *    fe80 0000 0000 0000  0000 00ff fe00 xxxx 2-byte short address IEEE 48-bit MAC
- *    fe80 0000 0000 0000  xxxx xxxx xxxx xxxx 8-byte extended address IEEE EUI-64
+ *    fe80 0000 0000 0000  0000 00ff fe00 xxxx 2-byte short address IEEE
+ *                                             48-bit MAC
+ *    fe80 0000 0000 0000  xxxx xxxx xxxx xxxx 8-byte extended address IEEE
+ *                                             EUI-64
  *
  ****************************************************************************/
 
diff --git a/net/sixlowpan/sixlowpan_send.c b/net/sixlowpan/sixlowpan_send.c
index 05d3a03..cbb5ef3 100644
--- a/net/sixlowpan/sixlowpan_send.c
+++ b/net/sixlowpan/sixlowpan_send.c
@@ -61,13 +61,16 @@
 
 struct sixlowpan_send_s
 {
-  FAR struct devif_callback_s *s_cb;      /* Reference to callback instance */
-  sem_t                        s_waitsem; /* Supports waiting for driver events */
-  int                          s_result;  /* The result of the transfer */
-  FAR const struct ipv6_hdr_s *s_ipv6hdr; /* IPv6 header, followed by UDP or ICMP header. */
+  FAR struct devif_callback_s *s_cb;            /* Reference to callback
+                                                 * instance */
+  sem_t                        s_waitsem;       /* Supports waiting for
+                                                 * driver events */
+  int                          s_result;        /* The result of the transfer */
+  FAR const struct ipv6_hdr_s *s_ipv6hdr;       /* IPv6 header, followed by
+                                                 * UDP or ICMP header. */
   FAR const struct netdev_varaddr_s *s_destmac; /* Destination MAC address */
-  FAR const void              *s_buf;     /* Data to send */
-  size_t                       s_len;     /* Length of data in buf */
+  FAR const void              *s_buf;           /* Data to send */
+  size_t                       s_len;           /* Length of data in buf */
 };
 
 /****************************************************************************
@@ -169,9 +172,9 @@ end_wait:
  * Name: sixlowpan_send
  *
  * Description:
- *   Process an outgoing UDP or ICMPv6 packet.  Takes an IP packet and formats
- *   it to be sent on an 802.15.4 network using 6lowpan.  Called from common
- *   UDP/ICMPv6 send logic.
+ *   Process an outgoing UDP or ICMPv6 packet.  Takes an IP packet and
+ *   formats it to be sent on an 802.15.4 network using 6lowpan.  Called
+ *   from common UDP/ICMPv6 send logic.
  *
  *   The payload data is in the caller 'buf' and is of length 'buflen'.
  *   Compressed headers will be added and if necessary the packet is
diff --git a/net/sixlowpan/sixlowpan_tcpsend.c b/net/sixlowpan/sixlowpan_tcpsend.c
index 95cc4b2..4dbff19 100644
--- a/net/sixlowpan/sixlowpan_tcpsend.c
+++ b/net/sixlowpan/sixlowpan_tcpsend.c
@@ -75,16 +75,18 @@
 
 struct sixlowpan_send_s
 {
-  FAR struct socket           *s_sock;    /* Internal socket reference */
-  FAR struct devif_callback_s *s_cb;      /* Reference to callback instance */
-  sem_t                        s_waitsem; /* Supports waiting for driver events */
-  int                          s_result;  /* The result of the transfer */
+  FAR struct socket           *s_sock;          /* Internal socket reference */
+  FAR struct devif_callback_s *s_cb;            /* Reference to callback
+                                                 * instance */
+  sem_t                        s_waitsem;       /* Supports waiting for
+                                                 * driver events */
+  int                          s_result;        /* The result of the transfer */
   FAR const struct netdev_varaddr_s *s_destmac; /* Destination MAC address */
-  FAR const uint8_t           *s_buf;     /* Data to send */
-  size_t                       s_buflen;  /* Length of data in buf */
-  ssize_t                      s_sent;    /* The number of bytes sent */
-  uint32_t                     s_isn;     /* Initial sequence number */
-  uint32_t                     s_acked;   /* The number of bytes acked */
+  FAR const uint8_t           *s_buf;           /* Data to send */
+  size_t                       s_buflen;        /* Length of data in buf */
+  ssize_t                      s_sent;          /* The number of bytes sent */
+  uint32_t                     s_isn;           /* Initial sequence number */
+  uint32_t                     s_acked;         /* The number of bytes acked */
 };
 
 /****************************************************************************
@@ -99,7 +101,8 @@ struct sixlowpan_send_s
  *   data payload as necessary.
  *
  * Input Parameters:
- *   ipv6tcp - A reference to a structure containing the IPv6 and TCP headers.
+ *   ipv6tcp - A reference to a structure containing the IPv6 and TCP
+ *             headers.
  *   buf     - The beginning of the payload data
  *   buflen  - The length of the payload data.
  *
@@ -449,15 +452,17 @@ static uint16_t tcp_send_eventhandler(FAR struct net_driver_s *dev,
         }
 
       ninfo("s_buflen=%u s_sent=%u mss=%u winsize=%u sndlen=%d\n",
-            sinfo->s_buflen, sinfo->s_sent, conn->mss, conn->winsize, sndlen);
+            sinfo->s_buflen, sinfo->s_sent, conn->mss, conn->winsize,
+            sndlen);
 
       if (sndlen > 0)
         {
-          /* Set the sequence number for this packet.  NOTE:  The network updates
-           * sndseq on receipt of ACK *before* this function is called.  In that
-           * case sndseq will point to the next unacknowledged byte (which might
-           * have already been sent).  We will overwrite the value of sndseq
-           * here before the packet is sent.
+          /* Set the sequence number for this packet.  NOTE:  The network
+           * updates sndseq on receipt of ACK *before* this function is
+           * called.  In that case sndseq will point to the next
+           * unacknowledged byte (which might have already been sent).  We
+           * will overwrite the value of sndseq here before the packet is
+           * sent.
            */
 
           seqno = sinfo->s_sent + sinfo->s_isn;
@@ -493,8 +498,8 @@ static uint16_t tcp_send_eventhandler(FAR struct net_driver_s *dev,
           /* Increment the count of bytes sent, the number of unacked bytes,
            * and the total count of TCP packets sent.
            *
-           * NOTE: tcp_appsend() normally increments conn->tx_unacked based on
-           * the value of dev->d_sndlen.  However, dev->d_len is always
+           * NOTE: tcp_appsend() normally increments conn->tx_unacked based
+           * on the value of dev->d_sndlen.  However, dev->d_len is always
            * zero for 6LoWPAN since it does not send via the dev->d_buf
            * but, rather, uses a backdoor frame interface with the IEEE
            * 802.15.4 MAC.
@@ -677,8 +682,8 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
  * Name: psock_6lowpan_tcp_send
  *
  * Description:
- *   psock_6lowpan_tcp_send() call may be used only when the TCP socket is in a
- *   connected state (so that the intended recipient is known).
+ *   psock_6lowpan_tcp_send() call may be used only when the TCP socket is
+ *   in a connected state (so that the intended recipient is known).
  *
  * Input Parameters:
  *   psock - An instance of the internal socket structure.
@@ -889,7 +894,8 @@ void sixlowpan_tcp_send(FAR struct net_driver_s *dev,
            * units of 32-bit words).
            */
 
-          hdrlen = IPv6_HDRLEN + (((uint16_t)ipv6hdr->tcp.tcpoffset >> 4) << 2);
+          hdrlen = IPv6_HDRLEN +
+                   (((uint16_t)ipv6hdr->tcp.tcpoffset >> 4) << 2);
 
           /* Drop the packet if the buffer length is less than this. */
 
diff --git a/net/sixlowpan/sixlowpan_udpsend.c b/net/sixlowpan/sixlowpan_udpsend.c
index 9085589..309504d 100644
--- a/net/sixlowpan/sixlowpan_udpsend.c
+++ b/net/sixlowpan/sixlowpan_udpsend.c
@@ -52,11 +52,12 @@
  * Name: sixlowpan_udp_chksum
  *
  * Description:
- *   Perform the checksum calcaultion over the IPv6, protocol headers, and
+ *   Perform the checksum calculation over the IPv6, protocol headers, and
  *   data payload as necessary.
  *
  * Input Parameters:
- *   ipv6udp - A reference to a structure containing the IPv6 and UDP headers.
+ *   ipv6udp - A reference to a structure containing the IPv6 and UDP
+ *             headers.
  *   buf     - The beginning of the payload data
  *   buflen  - The length of the payload data.
  *
@@ -238,7 +239,8 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
 
   /* Copy the source and destination addresses */
 
-  net_ipv6addr_hdrcopy(ipv6udp.ipv6.destipaddr, to6->sin6_addr.in6_u.u6_addr16);
+  net_ipv6addr_hdrcopy(ipv6udp.ipv6.destipaddr,
+                       to6->sin6_addr.in6_u.u6_addr16);
   if (!net_ipv6addr_cmp(conn->u.ipv6.laddr, g_ipv6_unspecaddr))
     {
       net_ipv6addr_hdrcopy(ipv6udp.ipv6.srcipaddr, conn->u.ipv6.laddr);
@@ -292,7 +294,8 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
 
   ret = sixlowpan_send(dev, &conn->list,
                        (FAR const struct ipv6_hdr_s *)&ipv6udp,
-                       buf, buflen, &destmac, _SO_TIMEOUT(psock->s_sndtimeo));
+                       buf, buflen, &destmac,
+                       _SO_TIMEOUT(psock->s_sndtimeo));
   if (ret < 0)
     {
       nerr("ERROR: sixlowpan_send() failed: %d\n", ret);