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 acb8ad4c7b1e92f35f24727de14bddeb7a21d1ae
Author: Alin Jerpelea <alin.jerpe...@sony.com>
AuthorDate: Mon Feb 8 16:19:12 2021 +0100

    mm: nxstyle fixes
    
    Nxstyle fixes to pass CI
    
    Signed-off-by: Alin Jerpelea <alin.jerpe...@sony.com>
---
 mm/iob/iob_alloc.c           | 2 +-
 mm/iob/iob_copyin.c          | 7 +++++--
 mm/iob/iob_dump.c            | 4 +++-
 mm/iob/iob_initialize.c      | 8 ++++++--
 mm/iob/iob_pack.c            | 4 +++-
 mm/iob/iob_statistics.c      | 3 ++-
 mm/mm_gran/mm_granalloc.c    | 4 +++-
 mm/mm_gran/mm_graninfo.c     | 4 +++-
 mm/mm_gran/mm_graninit.c     | 2 +-
 mm/mm_heap/mm_addfreechunk.c | 3 ++-
 mm/mm_heap/mm_extend.c       | 3 ++-
 mm/mm_heap/mm_memalign.c     | 9 +++++----
 mm/mm_heap/mm_shrinkchunk.c  | 3 ++-
 mm/shm/shm.h                 | 1 +
 14 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/mm/iob/iob_alloc.c b/mm/iob/iob_alloc.c
index 0fbaeac..27e1200 100644
--- a/mm/iob/iob_alloc.c
+++ b/mm/iob/iob_alloc.c
@@ -183,7 +183,7 @@ static FAR struct iob_s *iob_allocwait(bool throttled,
  * Name: iob_alloc
  *
  * Description:
- *   Allocate an I/O buffer by taking the buffer at the head of the free list.
+ *  Allocate an I/O buffer by taking the buffer at the head of the free list.
  *
  ****************************************************************************/
 
diff --git a/mm/iob/iob_copyin.c b/mm/iob/iob_copyin.c
index 17ceddd..875ce00 100644
--- a/mm/iob/iob_copyin.c
+++ b/mm/iob/iob_copyin.c
@@ -65,7 +65,9 @@ static int iob_copyin_internal(FAR struct iob_s *iob, FAR 
const uint8_t *src,
   iobinfo("iob=%p len=%u offset=%u\n", iob, len, offset);
   DEBUGASSERT(iob && src);
 
-  /* The offset must applied to data that is already in the I/O buffer chain */
+  /* The offset must applied to data that is already in the I/O buffer
+   * chain
+   */
 
   if (offset > iob->io_pktlen)
     {
@@ -218,7 +220,8 @@ int iob_copyin(FAR struct iob_s *iob, FAR const uint8_t 
*src,
                unsigned int len, unsigned int offset, bool throttled,
                enum iob_user_e consumerid)
 {
-  return iob_copyin_internal(iob, src, len, offset, throttled, true, 
consumerid);
+  return iob_copyin_internal(iob, src, len, offset,
+                             throttled, true, consumerid);
 }
 
 /****************************************************************************
diff --git a/mm/iob/iob_dump.c b/mm/iob/iob_dump.c
index 673aa89..1035cc9 100644
--- a/mm/iob/iob_dump.c
+++ b/mm/iob/iob_dump.c
@@ -120,7 +120,9 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, 
unsigned int len,
 
   for (lndx = 0; lndx < len; lndx += IOB_NITEMS, offset += IOB_NITEMS)
     {
-      /* Copy IOB_NITEMS-bytes into our local buffer from the current offset */
+      /* Copy IOB_NITEMS-bytes into our local buffer from the current
+       * offset
+       */
 
       nbytes = iob_copyout(data, head, IOB_NITEMS, offset);
 
diff --git a/mm/iob/iob_initialize.c b/mm/iob/iob_initialize.c
index f2b021f..bb6bae1 100644
--- a/mm/iob/iob_initialize.c
+++ b/mm/iob/iob_initialize.c
@@ -118,7 +118,9 @@ void iob_initialize(void)
 
       nxsem_init(&g_iob_sem, 0, CONFIG_IOB_NBUFFERS);
 #if CONFIG_IOB_THROTTLE > 0
-      nxsem_init(&g_throttle_sem, 0, CONFIG_IOB_NBUFFERS - 
CONFIG_IOB_THROTTLE);
+      nxsem_init(&g_throttle_sem,
+                 0,
+                 CONFIG_IOB_NBUFFERS - CONFIG_IOB_THROTTLE);
 #endif
 
 #if CONFIG_IOB_NCHAINS > 0
@@ -128,7 +130,9 @@ void iob_initialize(void)
         {
           FAR struct iob_qentry_s *iobq = &g_iob_qpool[i];
 
-          /* Add the pre-allocate buffer container to the head of the free 
list */
+          /* Add the pre-allocate buffer container to the head of the free
+           * list
+           */
 
           iobq->qe_flink  = g_iob_freeqlist;
           g_iob_freeqlist = iobq;
diff --git a/mm/iob/iob_pack.c b/mm/iob/iob_pack.c
index 53f97ff..317c064 100644
--- a/mm/iob/iob_pack.c
+++ b/mm/iob/iob_pack.c
@@ -99,7 +99,9 @@ FAR struct iob_s *iob_pack(FAR struct iob_s *iob,
 
           if (ncopy > 0)
             {
-              /* Copy the data from the next into the current I/O buffer iob */
+              /* Copy the data from the next into
+               * the current I/O buffer iob
+               */
 
               memcpy(&iob->io_data[iob->io_len],
                      &next->io_data[next->io_offset],
diff --git a/mm/iob/iob_statistics.c b/mm/iob/iob_statistics.c
index 0616683..b9414d6 100644
--- a/mm/iob/iob_statistics.c
+++ b/mm/iob/iob_statistics.c
@@ -113,7 +113,8 @@ void iob_stats_onfree(enum iob_user_e producerid)
  * Name: iob_getuserstats
  *
  * Description:
- *   Return a reference to the IOB usage statistics for the IOB 
consumer/producer
+ *   Return a reference to the IOB usage statistics for the IOB
+ *   consumer/producer
  *
  * Input Parameters:
  *   userid - id representing the IOB producer/consumer
diff --git a/mm/mm_gran/mm_granalloc.c b/mm/mm_gran/mm_granalloc.c
index 479cb94..79ebdb0 100644
--- a/mm/mm_gran/mm_granalloc.c
+++ b/mm/mm_gran/mm_granalloc.c
@@ -93,7 +93,9 @@ FAR void *gran_alloc(GRAN_HANDLE handle, size_t size)
       DEBUGASSERT(ngranules <= 32);
       mask = 0xffffffff >> (32 - ngranules);
 
-      /* Now search the granule allocation table for that number of contiguous 
*/
+      /* Now search the granule allocation table for that number
+       * of contiguous
+       */
 
       for (granidx = 0; granidx < priv->ngranules; granidx += 32)
         {
diff --git a/mm/mm_gran/mm_graninfo.c b/mm/mm_gran/mm_graninfo.c
index 6a7c55d..64bb0f0 100644
--- a/mm/mm_gran/mm_graninfo.c
+++ b/mm/mm_gran/mm_graninfo.c
@@ -614,7 +614,9 @@ void gran_info(GRAN_HANDLE handle, FAR struct graninfo_s 
*info)
         }
     }
 
-  /* Check if the last, unterminated sequence of free granules was the longest 
*/
+  /* Check if the last, unterminated sequence of free granules was
+   * the longest
+   */
 
   if (mxfree > info->mxfree)
     {
diff --git a/mm/mm_gran/mm_graninit.c b/mm/mm_gran/mm_graninit.c
index d85be59..a3acb93 100644
--- a/mm/mm_gran/mm_graninit.c
+++ b/mm/mm_gran/mm_graninit.c
@@ -55,7 +55,7 @@
  *   attribute to position a DMA heap in memory (logic in the linker script
  *   would assign the section .dmaheap to the DMA memory.
  *
- *     FAR uint32_t g_dmaheap[DMAHEAP_SIZE] __attribute__((section(.dmaheap)));
+ *   FAR uint32_t g_dmaheap[DMAHEAP_SIZE] __attribute__((section(.dmaheap)));
  *
  *   The heap is created by calling gran_initialize().  Here the granule size
  *   is set to 64 bytes (2**6) and the alignment to 16 bytes (2**4):
diff --git a/mm/mm_heap/mm_addfreechunk.c b/mm/mm_heap/mm_addfreechunk.c
index c0d6250..57da367 100644
--- a/mm/mm_heap/mm_addfreechunk.c
+++ b/mm/mm_heap/mm_addfreechunk.c
@@ -41,7 +41,8 @@
  *
  ****************************************************************************/
 
-void mm_addfreechunk(FAR struct mm_heap_s *heap, FAR struct mm_freenode_s 
*node)
+void mm_addfreechunk(FAR struct mm_heap_s *heap,
+                     FAR struct mm_freenode_s *node)
 {
   FAR struct mm_freenode_s *next;
   FAR struct mm_freenode_s *prev;
diff --git a/mm/mm_heap/mm_extend.c b/mm/mm_heap/mm_extend.c
index 690f1df..1dd91e6 100644
--- a/mm/mm_heap/mm_extend.c
+++ b/mm/mm_heap/mm_extend.c
@@ -59,7 +59,8 @@ void mm_extend(FAR struct mm_heap_s *heap, FAR void *mem, 
size_t size,
 
   DEBUGASSERT(heap && mem);
 #if CONFIG_MM_REGIONS > 1
-  DEBUGASSERT(size >= MIN_EXTEND && (size_t)region < 
(size_t)heap->mm_nregions);
+  DEBUGASSERT(size >= MIN_EXTEND &&
+             (size_t)region < (size_t)heap->mm_nregions);
 #else
   DEBUGASSERT(size >= MIN_EXTEND && region == 0);
 #endif
diff --git a/mm/mm_heap/mm_memalign.c b/mm/mm_heap/mm_memalign.c
index c6b59e0..b46d654 100644
--- a/mm/mm_heap/mm_memalign.c
+++ b/mm/mm_heap/mm_memalign.c
@@ -54,8 +54,8 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t 
alignment,
   size_t mask = (size_t)(alignment - 1);
   size_t allocsize;
 
-  /* If this requested alinement's less than or equal to the natural alignment
-   * of malloc, then just let malloc do the work.
+  /* If this requested alinement's less than or equal to the natural
+   * alignment of malloc, then just let malloc do the work.
    */
 
   if (alignment <= MM_MIN_CHUNK)
@@ -114,8 +114,9 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t 
alignment,
 
       next = (FAR struct mm_allocnode_s *)((FAR char *)node + node->size);
 
-      /* Make sure that there is space to convert the preceding mm_allocnode_s
-       * into an mm_freenode_s.  I think that this should always be true
+      /* Make sure that there is space to convert the preceding
+       * mm_allocnode_s into an mm_freenode_s.
+       * I think that this should always be true
        */
 
       DEBUGASSERT(alignedchunk >= rawchunk + 8);
diff --git a/mm/mm_heap/mm_shrinkchunk.c b/mm/mm_heap/mm_shrinkchunk.c
index 2846eed..1bb207c 100644
--- a/mm/mm_heap/mm_shrinkchunk.c
+++ b/mm/mm_heap/mm_shrinkchunk.c
@@ -67,7 +67,8 @@ void  mm_shrinkchunk(FAR struct mm_heap_s *heap,
 
       /* Get the chunk next the next node (which could be the tail chunk) */
 
-      andbeyond = (FAR struct mm_allocnode_s *)((FAR char *)next + next->size);
+      andbeyond = (FAR struct mm_allocnode_s *)
+                  ((FAR char *)next + next->size);
 
       /* Remove the next node.  There must be a predecessor, but there may
        * not be a successor node.
diff --git a/mm/shm/shm.h b/mm/shm/shm.h
index cb54349..97045af 100644
--- a/mm/shm/shm.h
+++ b/mm/shm/shm.h
@@ -39,6 +39,7 @@
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
+
 /* Bit definitions for the struct shm_region_s sr_flags field */
 
 #define SRFLAG_AVAILABLE 0        /* Available if no flag bits set */

Reply via email to