diff --git a/mm/mm_heap/mm.h b/mm/mm_heap/mm.h index 80d5c52d4d..2aef1551e1 100644 --- a/mm/mm_heap/mm.h +++ b/mm/mm_heap/mm.h @@ -91,7 +91,7 @@ #define MM_MAX_CHUNK (1 << MM_MAX_SHIFT) #define MM_NNODES (MM_MAX_SHIFT - MM_MIN_SHIFT + 1) -#define MM_GRAN_MASK (MM_MIN_CHUNK-1) +#define MM_GRAN_MASK (MM_MIN_CHUNK - 1) #define MM_ALIGN_UP(a) (((a) + MM_GRAN_MASK) & ~MM_GRAN_MASK) #define MM_ALIGN_DOWN(a) ((a) & ~MM_GRAN_MASK) @@ -105,7 +105,7 @@ # define MM_ALLOC_BIT 0x80000000 #endif #define MM_IS_ALLOCATED(n) \ - ((int)((struct mm_allocnode_s*)(n)->preceding) < 0) + ((int)((FAR struct mm_allocnode_s *)(n)->preceding) < 0) /**************************************************************************** * Public Types @@ -155,7 +155,7 @@ struct mm_freenode_s struct mm_delaynode_s { - struct mm_delaynode_s *flink; + FAR struct mm_delaynode_s *flink; }; /* What is the size of the freenode? */ @@ -200,7 +200,7 @@ struct mm_heap_impl_s /* Free delay list, for some situation can't do free immdiately */ - struct mm_delaynode_s *mm_delaylist; + FAR struct mm_delaynode_s *mm_delaylist; }; /* Functions contained in mm_shrinkchunk.c **********************************/ diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c index 74bdf9e7fd..067ad8df64 100644 --- a/mm/mm_heap/mm_malloc.c +++ b/mm/mm_heap/mm_malloc.c @@ -104,7 +104,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size) FAR struct mm_heap_impl_s *heap_impl; FAR struct mm_freenode_s *node; size_t alignsize; - void *ret = NULL; + FAR void *ret = NULL; int ndx; DEBUGASSERT(MM_IS_VALID(heap)); @@ -224,7 +224,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size) /* Handle the case of an exact size match */ node->preceding |= MM_ALLOC_BIT; - ret = (void *)((FAR char *)node + SIZEOF_MM_ALLOCNODE); + ret = (FAR void *)((FAR char *)node + SIZEOF_MM_ALLOCNODE); } DEBUGASSERT(ret == NULL || mm_heapmember(heap, ret));