diff --git a/arch b/arch index ecb67120352..8faab42f9a4 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit ecb67120352a5acc46c6ea06fe882ddfb597824f +Subproject commit 8faab42f9a4c9170b35bfb68ef40b2e54ba83320 diff --git a/audio/audio.c b/audio/audio.c index f09fe631f0b..a1f0db3834c 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -379,7 +379,7 @@ static int audio_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case AUDIOIOC_GETCAPS: { - FAR struct audio_caps_s *caps = (FAR struct audio_caps_s*)((uintptr_t)arg); + FAR struct audio_caps_s *caps = (FAR struct audio_caps_s *)((uintptr_t)arg); DEBUGASSERT(lower->ops->getcaps != NULL); audvdbg("AUDIOIOC_GETCAPS: Device=%d\n", caps->ac_type); @@ -393,7 +393,7 @@ static int audio_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case AUDIOIOC_CONFIGURE: { FAR const struct audio_caps_desc_s *caps = - (FAR const struct audio_caps_desc_s*)((uintptr_t)arg); + (FAR const struct audio_caps_desc_s *)((uintptr_t)arg); DEBUGASSERT(lower->ops->configure != NULL); audvdbg("AUDIOIOC_INITIALIZE: Device=%d\n", caps->caps.ac_type); @@ -873,11 +873,11 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev) char path[AUDIO_MAX_DEVICE_PATH]; static bool dev_audio_created = false; #ifndef CONFIG_AUDIO_CUSTOM_DEV_PATH - const char* devname = "/dev/audio"; + FAR const char *devname = "/dev/audio"; #elif !defined(CONFIG_AUDIO_DEV_ROOT) - const char* devname = CONFIG_AUDIO_DEV_PATH; - const char* ptr; - char* pathptr; + FAR const char *devname = CONFIG_AUDIO_DEV_PATH; + FAR const char *ptr; + FAR char *pathptr; #endif /* Allocate the upper-half data structure */ diff --git a/audio/pcm_decode.c b/audio/pcm_decode.c index b8808a2cb7d..d57d5dbb9b2 100644 --- a/audio/pcm_decode.c +++ b/audio/pcm_decode.c @@ -259,23 +259,23 @@ static void pcm_callback(FAR void *arg, uint16_t reason, #ifdef CONFIG_PCM_DEBUG static void pcm_dump(FAR const struct wav_header_s *wav) { - dbg( "Wave file header\n"); - dbg( " Header Chunk:\n"); - dbg( " Chunk ID: 0x%08x\n", wav->hdr.chunkid); - dbg( " Chunk Size: %u\n", wav->hdr.chunklen); - dbg( " Format: 0x%08x\n", wav->hdr.format); - dbg( " Format Chunk:\n"); - dbg( " Chunk ID: 0x%08x\n", wav->fmt.chunkid); - dbg( " Chunk Size: %u\n", wav->fmt.chunklen); - dbg( " Audio Format: 0x%04x\n", wav->fmt.format); - dbg( " Num. Channels: %d\n", wav->fmt.nchannels); - dbg( " Sample Rate: %u\n", wav->fmt.samprate); - dbg( " Byte Rate: %u\n", wav->fmt.byterate); - dbg( " Block Align: %d\n", wav->fmt.align); - dbg( " Bits Per Sample: %d\n", wav->fmt.bpsamp); - dbg( " Data Chunk:\n"); - dbg( " Chunk ID: 0x%08x\n", wav->data.chunkid); - dbg( " Chunk Size: %u\n", wav->data.chunklen); + dbg("Wave file header\n"); + dbg(" Header Chunk:\n"); + dbg(" Chunk ID: 0x%08x\n", wav->hdr.chunkid); + dbg(" Chunk Size: %u\n", wav->hdr.chunklen); + dbg(" Format: 0x%08x\n", wav->hdr.format); + dbg(" Format Chunk:\n"); + dbg(" Chunk ID: 0x%08x\n", wav->fmt.chunkid); + dbg(" Chunk Size: %u\n", wav->fmt.chunklen); + dbg(" Audio Format: 0x%04x\n", wav->fmt.format); + dbg(" Num. Channels: %d\n", wav->fmt.nchannels); + dbg(" Sample Rate: %u\n", wav->fmt.samprate); + dbg(" Byte Rate: %u\n", wav->fmt.byterate); + dbg(" Block Align: %d\n", wav->fmt.align); + dbg(" Bits Per Sample: %d\n", wav->fmt.bpsamp); + dbg(" Data Chunk:\n"); + dbg(" Chunk ID: 0x%08x\n", wav->data.chunkid); + dbg(" Chunk Size: %u\n", wav->data.chunklen); } #endif diff --git a/crypto/cryptodev.c b/crypto/cryptodev.c index f6753effb58..c81585c3291 100644 --- a/crypto/cryptodev.c +++ b/crypto/cryptodev.c @@ -96,11 +96,11 @@ static ssize_t cryptodev_write(FAR struct file *filep, FAR const char *buffer, static int cryptodev_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { - switch(cmd) + switch (cmd) { case CIOCGSESSION: { - struct session_op *ses = (struct session_op*)arg; + FAR struct session_op *ses = (FAR struct session_op *)arg; ses->ses = (uint32_t)ses; return OK; } @@ -112,8 +112,8 @@ static int cryptodev_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case CIOCCRYPT: { - FAR struct crypt_op *op = (struct crypt_op*)arg; - FAR struct session_op *ses = (struct session_op*)op->ses; + FAR struct crypt_op *op = (FAR struct crypt_op *)arg; + FAR struct session_op *ses = (FAR struct session_op *)op->ses; int encrypt; switch (op->op) diff --git a/crypto/testmngr.c b/crypto/testmngr.c index 2dacdd0c42a..c7fe86e78ad 100644 --- a/crypto/testmngr.c +++ b/crypto/testmngr.c @@ -68,7 +68,7 @@ * Private Functions ****************************************************************************/ -static int do_test_aes(FAR struct cipher_testvec* test, int mode, int encrypt) +static int do_test_aes(FAR struct cipher_testvec *test, int mode, int encrypt) { FAR void *out = kmm_zalloc(test->rlen); diff --git a/graphics/nxbe/nxbe_colormap.c b/graphics/nxbe/nxbe_colormap.c index d5d84e238c8..1443206068f 100644 --- a/graphics/nxbe/nxbe_colormap.c +++ b/graphics/nxbe/nxbe_colormap.c @@ -85,16 +85,18 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev) { struct fb_cmap_s cmap; - uint8_t *alloc; - uint8_t *red; - uint8_t *green; - uint8_t *blue; + FAR uint8_t *alloc; + FAR uint8_t *red; + FAR uint8_t *green; + FAR uint8_t *blue; uint8_t rval; uint8_t gval; int size; int ndx; int ret; - int i, j, k; + int i; + int j; + int k; /* Allocate the color map tables in one allocation: * @@ -102,7 +104,7 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev) */ size = 3 * CONFIG_NX_NCOLORS * sizeof(uint8_t); - alloc = (uint8_t*)kmm_malloc(size); + alloc = (FAR uint8_t *)kmm_malloc(size); if (alloc == NULL) { return -ENOMEM; diff --git a/graphics/nxglib/fb/nxglib_copyrectangle.c b/graphics/nxglib/fb/nxglib_copyrectangle.c index 0a6c12d414f..ea0d1ad2e7e 100644 --- a/graphics/nxglib/fb/nxglib_copyrectangle.c +++ b/graphics/nxglib/fb/nxglib_copyrectangle.c @@ -79,7 +79,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX) (FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *dest, FAR const void *src, FAR const struct nxgl_point_s *origin, unsigned int srcstride) @@ -131,7 +131,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX) /* Then copy the image */ - sline = (const uint8_t*)src + NXGL_SCALEX(dest->pt1.x - origin->x) + (dest->pt1.y - origin->y) * srcstride; + sline = (FAR const uint8_t *)src + NXGL_SCALEX(dest->pt1.x - origin->x) + (dest->pt1.y - origin->y) * srcstride; dline = pinfo->fbmem + dest->pt1.y * deststride + NXGL_SCALEX(dest->pt1.x); while (rows--) @@ -171,7 +171,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX) #else /* Copy the whole line */ - NXGL_MEMCPY((NXGL_PIXEL_T*)dline, (NXGL_PIXEL_T*)sline, width); + NXGL_MEMCPY((NXGL_PIXEL_T *)dline, (NXGL_PIXEL_T *)sline, width); #endif dline += deststride; sline += srcstride; diff --git a/graphics/nxglib/fb/nxglib_fillrectangle.c b/graphics/nxglib/fb/nxglib_fillrectangle.c index 3125004c9d9..baaad84697b 100644 --- a/graphics/nxglib/fb/nxglib_fillrectangle.c +++ b/graphics/nxglib/fb/nxglib_fillrectangle.c @@ -82,7 +82,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX) (FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect, NXGL_PIXEL_T color) diff --git a/graphics/nxglib/fb/nxglib_filltrapezoid.c b/graphics/nxglib/fb/nxglib_filltrapezoid.c index 789ae7cee1d..dcf29faad4f 100644 --- a/graphics/nxglib/fb/nxglib_filltrapezoid.c +++ b/graphics/nxglib/fb/nxglib_filltrapezoid.c @@ -70,7 +70,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)( +void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX)( FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_trapezoid_s *trap, FAR const struct nxgl_rect_s *bounds, diff --git a/graphics/nxglib/fb/nxglib_getrectangle.c b/graphics/nxglib/fb/nxglib_getrectangle.c index c1a9e1ee2de..39386b4cbd7 100644 --- a/graphics/nxglib/fb/nxglib_getrectangle.c +++ b/graphics/nxglib/fb/nxglib_getrectangle.c @@ -127,7 +127,7 @@ static inline void nxgl_lowresmemcpy(FAR uint8_t *dline, FAR const uint8_t *slin * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_getrectangle,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX) (FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect, FAR void *dest, unsigned int deststride) { diff --git a/graphics/nxglib/fb/nxglib_setpixel.c b/graphics/nxglib/fb/nxglib_setpixel.c index 29f83bbaa3b..c1c764f716f 100644 --- a/graphics/nxglib/fb/nxglib_setpixel.c +++ b/graphics/nxglib/fb/nxglib_setpixel.c @@ -84,7 +84,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_setpixel,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX) (FAR struct fb_planeinfo_s *pinfo, FAR const struct nxgl_point_s *pos, NXGL_PIXEL_T color) diff --git a/graphics/nxglib/lcd/nxglib_copyrectangle.c b/graphics/nxglib/lcd/nxglib_copyrectangle.c index 1194ff8e1b7..0c5e266c620 100644 --- a/graphics/nxglib/lcd/nxglib_copyrectangle.c +++ b/graphics/nxglib/lcd/nxglib_copyrectangle.c @@ -81,7 +81,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_copyrectangle, NXGLIB_SUFFIX) (FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *dest, FAR const void *src, FAR const struct nxgl_point_s *origin, unsigned int srcstride) @@ -103,7 +103,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX) /* Set up to copy the image */ xoffset = dest->pt1.x - origin->x; - sline = (const uint8_t*)src + NXGL_SCALEX(xoffset) + (dest->pt1.y - origin->y) * srcstride; + sline = (FAR const uint8_t *)src + NXGL_SCALEX(xoffset) + (dest->pt1.y - origin->y) * srcstride; #if NXGLIB_BITSPERPIXEL < 8 remainder = NXGL_REMAINDERX(xoffset); #endif @@ -119,7 +119,7 @@ void NXGL_FUNCNAME(nxgl_copyrectangle,NXGLIB_SUFFIX) if (remainder != 0) { - NXGL_FUNCNAME(nxgl_copyrun,NXGLIB_SUFFIX)(sline, pinfo->buffer, remainder, ncols); + NXGL_FUNCNAME(nxgl_copyrun, NXGLIB_SUFFIX)(sline, pinfo->buffer, remainder, ncols); (void)pinfo->putrun(row, dest->pt1.x, pinfo->buffer, ncols); } else diff --git a/graphics/nxglib/lcd/nxglib_fillrectangle.c b/graphics/nxglib/lcd/nxglib_fillrectangle.c index 6e0911713d1..6bc9a04fcb1 100644 --- a/graphics/nxglib/lcd/nxglib_fillrectangle.c +++ b/graphics/nxglib/lcd/nxglib_fillrectangle.c @@ -84,7 +84,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_fillrectangle, NXGLIB_SUFFIX) (FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect, NXGL_PIXEL_T color) @@ -98,7 +98,7 @@ void NXGL_FUNCNAME(nxgl_fillrectangle,NXGLIB_SUFFIX) /* Fill the run buffer with the selected color */ - NXGL_FUNCNAME(nxgl_fillrun,NXGLIB_SUFFIX)((NXGLIB_RUNTYPE*)pinfo->buffer, color, ncols); + NXGL_FUNCNAME(nxgl_fillrun, NXGLIB_SUFFIX)((NXGLIB_RUNTYPE *)pinfo->buffer, color, ncols); /* Then fill the rectangle line-by-line */ diff --git a/graphics/nxglib/lcd/nxglib_filltrapezoid.c b/graphics/nxglib/lcd/nxglib_filltrapezoid.c index df81971fb9f..c88cae9542d 100644 --- a/graphics/nxglib/lcd/nxglib_filltrapezoid.c +++ b/graphics/nxglib/lcd/nxglib_filltrapezoid.c @@ -86,7 +86,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_filltrapezoid, NXGLIB_SUFFIX) (FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_trapezoid_s *trap, FAR const struct nxgl_rect_s *bounds, @@ -215,7 +215,7 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX) ncols = botw; } - NXGL_FUNCNAME(nxgl_fillrun,NXGLIB_SUFFIX)((NXGLIB_RUNTYPE*)pinfo->buffer, color, ncols); + NXGL_FUNCNAME(nxgl_fillrun, NXGLIB_SUFFIX)((NXGLIB_RUNTYPE *)pinfo->buffer, color, ncols); /* Then fill the trapezoid row-by-row */ diff --git a/graphics/nxglib/lcd/nxglib_getrectangle.c b/graphics/nxglib/lcd/nxglib_getrectangle.c index 05bf78d666d..1d6ecb5e60b 100644 --- a/graphics/nxglib/lcd/nxglib_getrectangle.c +++ b/graphics/nxglib/lcd/nxglib_getrectangle.c @@ -79,7 +79,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_getrectangle,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_getrectangle, NXGLIB_SUFFIX) (FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect, FAR void *dest, unsigned int deststride) { diff --git a/graphics/nxglib/lcd/nxglib_moverectangle.c b/graphics/nxglib/lcd/nxglib_moverectangle.c index d634f2141c4..02a84df098e 100644 --- a/graphics/nxglib/lcd/nxglib_moverectangle.c +++ b/graphics/nxglib/lcd/nxglib_moverectangle.c @@ -81,7 +81,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_moverectangle,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_moverectangle, NXGLIB_SUFFIX) (FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_rect_s *rect, FAR struct nxgl_point_s *offset) { diff --git a/graphics/nxglib/lcd/nxglib_setpixel.c b/graphics/nxglib/lcd/nxglib_setpixel.c index 46b637575bc..2af2c77a14c 100644 --- a/graphics/nxglib/lcd/nxglib_setpixel.c +++ b/graphics/nxglib/lcd/nxglib_setpixel.c @@ -85,7 +85,7 @@ * ****************************************************************************/ -void NXGL_FUNCNAME(nxgl_setpixel,NXGLIB_SUFFIX) +void NXGL_FUNCNAME(nxgl_setpixel, NXGLIB_SUFFIX) (FAR struct lcd_planeinfo_s *pinfo, FAR const struct nxgl_point_s *pos, NXGL_PIXEL_T color) diff --git a/graphics/nxmu/nxmu_server.c b/graphics/nxmu/nxmu_server.c index 1f13dba9081..a5dad6ec40b 100644 --- a/graphics/nxmu/nxmu_server.c +++ b/graphics/nxmu/nxmu_server.c @@ -214,7 +214,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, attr.mq_msgsize = NX_MXSVRMSGLEN; attr.mq_flags = 0; - fe->conn.crdmq = mq_open(mqname, O_RDONLY|O_CREAT, 0666, &attr); + fe->conn.crdmq = mq_open(mqname, O_RDONLY | O_CREAT, 0666, &attr); if (fe->conn.crdmq == (mqd_t)-1) { gdbg("mq_open(%s) failed: %d\n", mqname, errno); @@ -245,7 +245,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, /* Initialize the non-NULL elements of the background window */ fe->be.bkgd.conn = &fe->conn; - fe->be.bkgd.be = (FAR struct nxbe_state_s*)fe; + fe->be.bkgd.be = (FAR struct nxbe_state_s *)fe; fe->be.bkgd.bounds.pt2.x = fe->be.vinfo.xres - 1; fe->be.bkgd.bounds.pt2.y = fe->be.vinfo.yres - 1; @@ -325,7 +325,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev) /* Then loop forever processing incoming messages */ - for (;;) + for (; ; ) { /* Receive the next server message */ diff --git a/graphics/nxterm/nxterm_font.c b/graphics/nxterm/nxterm_font.c index 013deab581f..fec6d5a443b 100644 --- a/graphics/nxterm/nxterm_font.c +++ b/graphics/nxterm/nxterm_font.c @@ -311,7 +311,7 @@ nxterm_renderglyph(FAR struct nxterm_state_s *priv, /* Then render the glyph into the allocated memory */ - ret = RENDERER((FAR nxgl_mxpixel_t*)glyph->bitmap, + ret = RENDERER((FAR nxgl_mxpixel_t *)glyph->bitmap, glyph->height, glyph->width, glyph->stride, fbm, priv->wndo.fcolor[0]); if (ret < 0) diff --git a/graphics/nxterm/nxterm_register.c b/graphics/nxterm/nxterm_register.c index 6a49e641cf6..a0751773d7a 100644 --- a/graphics/nxterm/nxterm_register.c +++ b/graphics/nxterm/nxterm_register.c @@ -96,7 +96,7 @@ FAR struct nxterm_state_s * priv->ops = ops; priv->handle = handle; priv->minor = minor; - memcpy(&priv->wndo, wndo, sizeof( struct nxterm_window_s)); + memcpy(&priv->wndo, wndo, sizeof(struct nxterm_window_s)); sem_init(&priv->exclsem, 0, 1); #ifdef CONFIG_DEBUG diff --git a/graphics/nxterm/nxterm_scroll.c b/graphics/nxterm/nxterm_scroll.c index 9d1827606fb..38e9f5cb6bf 100644 --- a/graphics/nxterm/nxterm_scroll.c +++ b/graphics/nxterm/nxterm_scroll.c @@ -136,7 +136,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv, /* Finally, clear the vacated part of the display */ rect.pt1.y = bottom; - rect.pt2.y = priv->wndo.wsize.h- 1; + rect.pt2.y = priv->wndo.wsize.h - 1; ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); if (ret < 0) diff --git a/mm/mm_gran/mm_graninit.c b/mm/mm_gran/mm_graninit.c index 0d4bf18b7f2..9da0de1fc88 100644 --- a/mm/mm_gran/mm_graninit.c +++ b/mm/mm_gran/mm_graninit.c @@ -127,7 +127,7 @@ gran_common_initialize(FAR void *heapstart, size_t heapsize, uint8_t log2gran, * correct size. */ - priv = ( FAR struct gran_s *)kmm_zalloc(SIZEOF_GRAN_S(ngranules)); + priv = (FAR struct gran_s *)kmm_zalloc(SIZEOF_GRAN_S(ngranules)); if (priv) { /* Initialize non-zero elements of the granules heap info structure */ diff --git a/mm/mm_gran/mm_granmark.c b/mm/mm_gran/mm_granmark.c index 91bfdb09719..d9dfcb9ec6f 100644 --- a/mm/mm_gran/mm_granmark.c +++ b/mm/mm_gran/mm_granmark.c @@ -100,7 +100,7 @@ void gran_mark_allocated(FAR struct gran_s *priv, uintptr_t alloc, { /* Mark bits in the first GAT entry */ - gatmask =0xffffffff << gatbit; + gatmask = 0xffffffff << gatbit; DEBUGASSERT((priv->gat[gatidx] & gatmask) == 0); priv->gat[gatidx] |= gatmask; diff --git a/mm/mm_gran/mm_pgalloc.c b/mm/mm_gran/mm_pgalloc.c index c4bda32d325..474d9e0f4ea 100644 --- a/mm/mm_gran/mm_pgalloc.c +++ b/mm/mm_gran/mm_pgalloc.c @@ -208,9 +208,9 @@ uintptr_t mm_pgalloc(unsigned int npages) void mm_pgfree(uintptr_t paddr, unsigned int npages) { #ifdef CONFIG_GRAN_SINGLE - gran_free((FAR void*)paddr, (size_t)npages << MM_PGSHIFT); + gran_free((FAR void *)paddr, (size_t)npages << MM_PGSHIFT); #else - gran_free(g_pgalloc, (FAR void*)paddr, (size_t)npages << MM_PGSHIFT); + gran_free(g_pgalloc, (FAR void *)paddr, (size_t)npages << MM_PGSHIFT); #endif } diff --git a/mm/mm_heap/mm_free.c b/mm/mm_heap/mm_free.c index ae0f50d3c74..a08682676d5 100644 --- a/mm/mm_heap/mm_free.c +++ b/mm/mm_heap/mm_free.c @@ -88,12 +88,12 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem) /* Map the memory chunk into a free node */ - node = (FAR struct mm_freenode_s *)((char*)mem - SIZEOF_MM_ALLOCNODE); + node = (FAR struct mm_freenode_s *)((FAR char *)mem - SIZEOF_MM_ALLOCNODE); node->preceding &= ~MM_ALLOC_BIT; /* Check if the following node is free and, if so, merge it */ - next = (FAR struct mm_freenode_s *)((char*)node + node->size); + next = (FAR struct mm_freenode_s *)((FAR char *)node + node->size); if ((next->preceding & MM_ALLOC_BIT) == 0) { FAR struct mm_allocnode_s *andbeyond; @@ -103,7 +103,7 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem) * index past the tail chunk because it is always allocated. */ - andbeyond = (FAR struct mm_allocnode_s*)((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. @@ -127,7 +127,7 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem) * it with this node */ - prev = (FAR struct mm_freenode_s *)((char*)node - node->preceding); + prev = (FAR struct mm_freenode_s *)((FAR char *)node - node->preceding); if ((prev->preceding & MM_ALLOC_BIT) == 0) { /* Remove the node. There must be a predecessor, but there may diff --git a/mm/mm_heap/mm_mallinfo.c b/mm/mm_heap/mm_mallinfo.c index 9b97760dd8b..5aa720e7a9b 100644 --- a/mm/mm_heap/mm_mallinfo.c +++ b/mm/mm_heap/mm_mallinfo.c @@ -71,7 +71,7 @@ int mm_mallinfo(FAR struct mm_heap_s *heap, FAR struct mallinfo *info) { - struct mm_allocnode_s *node; + FAR struct mm_allocnode_s *node; size_t mxordblk = 0; int ordblks = 0; /* Number of non-inuse chunks */ size_t uordblks = 0; /* Total allocated space */ @@ -98,7 +98,7 @@ int mm_mallinfo(FAR struct mm_heap_s *heap, FAR struct mallinfo *info) for (node = heap->mm_heapstart[region]; node < heap->mm_heapend[region]; - node = (struct mm_allocnode_s *)((char*)node + node->size)) + node = (FAR struct mm_allocnode_s *)((FAR char *)node + node->size)) { mvdbg("region=%d node=%p size=%p preceding=%p (%c)\n", region, node, node->size, (node->preceding & ~MM_ALLOC_BIT), diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c index 9890e5712c7..e1ed4b8c159 100644 --- a/mm/mm_heap/mm_malloc.c +++ b/mm/mm_heap/mm_malloc.c @@ -49,7 +49,7 @@ ****************************************************************************/ #ifndef NULL -# define NULL ((void*)0) +# define NULL ((void *)0) #endif /**************************************************************************** @@ -164,11 +164,11 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size) { /* Get a pointer to the next node in physical memory */ - next = (FAR struct mm_freenode_s*)(((char*)node) + node->size); + next = (FAR struct mm_freenode_s *)(((FAR char *)node) + node->size); /* Create the remainder node */ - remainder = (FAR struct mm_freenode_s*)(((char*)node) + size); + remainder = (FAR struct mm_freenode_s *)(((FAR char *)node) + size); remainder->size = remaining; remainder->preceding = size; @@ -190,7 +190,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*)((char*)node + SIZEOF_MM_ALLOCNODE); + ret = (void *)((FAR char *)node + SIZEOF_MM_ALLOCNODE); } mm_givesemaphore(heap); diff --git a/mm/mm_heap/mm_memalign.c b/mm/mm_heap/mm_memalign.c index aa7971c0cb8..06098856533 100644 --- a/mm/mm_heap/mm_memalign.c +++ b/mm/mm_heap/mm_memalign.c @@ -119,7 +119,7 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment, * the allocation. */ - node = (FAR struct mm_allocnode_s*)(rawchunk - SIZEOF_MM_ALLOCNODE); + node = (FAR struct mm_allocnode_s *)(rawchunk - SIZEOF_MM_ALLOCNODE); /* Find the aligned subregion */ @@ -135,7 +135,7 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment, /* Get the node the next node after the allocation. */ - next = (FAR struct mm_allocnode_s*)((char*)node + node->size); + 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 @@ -143,7 +143,7 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment, DEBUGASSERT(alignedchunk >= rawchunk + 8); - newnode = (FAR struct mm_allocnode_s*)(alignedchunk - SIZEOF_MM_ALLOCNODE); + newnode = (FAR struct mm_allocnode_s *)(alignedchunk - SIZEOF_MM_ALLOCNODE); /* Preceding size is full size of the new 'node,' including * SIZEOF_MM_ALLOCNODE @@ -162,7 +162,7 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment, if (precedingsize < SIZEOF_MM_FREENODE) { alignedchunk += alignment; - newnode = (FAR struct mm_allocnode_s*)(alignedchunk - SIZEOF_MM_ALLOCNODE); + newnode = (FAR struct mm_allocnode_s *)(alignedchunk - SIZEOF_MM_ALLOCNODE); precedingsize = (size_t)newnode - (size_t)node; } @@ -210,5 +210,5 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment, } mm_givesemaphore(heap); - return (FAR void*)alignedchunk; + return (FAR void *)alignedchunk; } diff --git a/mm/mm_heap/mm_realloc.c b/mm/mm_heap/mm_realloc.c index ef592b7cf4c..7b6e75f2980 100644 --- a/mm/mm_heap/mm_realloc.c +++ b/mm/mm_heap/mm_realloc.c @@ -115,7 +115,7 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, /* Map the memory chunk into an allocated node structure */ - oldnode = (FAR struct mm_allocnode_s *)((FAR char*)oldmem - SIZEOF_MM_ALLOCNODE); + oldnode = (FAR struct mm_allocnode_s *)((FAR char *)oldmem - SIZEOF_MM_ALLOCNODE); /* We need to hold the MM semaphore while we muck with the nodelist. */ @@ -146,13 +146,13 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, * best decision */ - next = (FAR struct mm_freenode_s *)((FAR char*)oldnode + oldnode->size); + next = (FAR struct mm_freenode_s *)((FAR char *)oldnode + oldnode->size); if ((next->preceding & MM_ALLOC_BIT) == 0) { nextsize = next->size; } - prev = (FAR struct mm_freenode_s *)((FAR char*)oldnode - (oldnode->preceding & ~MM_ALLOC_BIT)); + prev = (FAR struct mm_freenode_s *)((FAR char *)oldnode - (oldnode->preceding & ~MM_ALLOC_BIT)); if ((prev->preceding & MM_ALLOC_BIT) == 0) { prevsize = prev->size; @@ -240,7 +240,7 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, /* Extend the node into the previous free chunk */ - newnode = (FAR struct mm_allocnode_s *)((FAR char*)oldnode - takeprev); + newnode = (FAR struct mm_allocnode_s *)((FAR char *)oldnode - takeprev); /* Did we consume the entire preceding chunk? */ @@ -277,7 +277,7 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, * should be save for this. */ - newmem = (FAR void*)((FAR char*)newnode + SIZEOF_MM_ALLOCNODE); + newmem = (FAR void *)((FAR char *)newnode + SIZEOF_MM_ALLOCNODE); memcpy(newmem, oldmem, oldsize - SIZEOF_MM_ALLOCNODE); } @@ -292,7 +292,7 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, * chunk) */ - andbeyond = (FAR struct mm_allocnode_s*)((char*)next + nextsize); + andbeyond = (FAR struct mm_allocnode_s *)((FAR char *)next + nextsize); /* Remove the next node. There must be a predecessor, but there * may not be a successor node. @@ -308,7 +308,7 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, /* Extend the node into the next chunk */ oldnode->size = oldsize + takenext; - newnode = (FAR struct mm_freenode_s *)((char*)oldnode + oldnode->size); + newnode = (FAR struct mm_freenode_s *)((FAR char *)oldnode + oldnode->size); /* Did we consume the entire preceding chunk? */ @@ -347,7 +347,7 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, */ mm_givesemaphore(heap); - newmem = (FAR void*)mm_malloc(heap, size); + newmem = (FAR void *)mm_malloc(heap, size); if (newmem) { memcpy(newmem, oldmem, oldsize); diff --git a/mm/mm_heap/mm_sbrk.c b/mm/mm_heap/mm_sbrk.c index a0f868012eb..19a91cc3dd8 100644 --- a/mm/mm_heap/mm_sbrk.c +++ b/mm/mm_heap/mm_sbrk.c @@ -75,7 +75,7 @@ * heap - A reference to the data structure that defines this heap. * incr - Specifies the number of bytes to add or to remove from the * space allocated for the process. - maxbreak - The maximum permissible break address. + * maxbreak - The maximum permissible break address. * * Returned Value: * Upon successful completion, sbrk() returns the prior break value. diff --git a/mm/mm_heap/mm_shrinkchunk.c b/mm/mm_heap/mm_shrinkchunk.c index ab6c39c20a0..c829876079f 100644 --- a/mm/mm_heap/mm_shrinkchunk.c +++ b/mm/mm_heap/mm_shrinkchunk.c @@ -73,7 +73,7 @@ void mm_shrinkchunk(FAR struct mm_heap_s *heap, /* Get a reference to the next node */ - next = (FAR struct mm_freenode_s*)((char*)node + node->size); + next = (FAR struct mm_freenode_s *)((FAR char *)node + node->size); /* Check if it is free */ @@ -84,7 +84,7 @@ 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*)((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. @@ -101,7 +101,7 @@ void mm_shrinkchunk(FAR struct mm_heap_s *heap, * tailing memory from the aligned chunk. */ - newnode = (FAR struct mm_freenode_s*)((char*)node + size); + newnode = (FAR struct mm_freenode_s *)((FAR char *)node + size); /* Set up the size of the new node */ @@ -127,7 +127,7 @@ void mm_shrinkchunk(FAR struct mm_heap_s *heap, * tailing memory from the aligned chunk. */ - newnode = (FAR struct mm_freenode_s*)((char*)node + size); + newnode = (FAR struct mm_freenode_s *)((FAR char *)node + size); /* Set up the size of the new node */