diff --git a/examples/camera/camera_main.c b/examples/camera/camera_main.c index 288f6170c..54c6ab5b5 100644 --- a/examples/camera/camera_main.c +++ b/examples/camera/camera_main.c @@ -719,15 +719,12 @@ exit_this_app: free_buffer(buffers_still, STILL_BUFNUM); exit_without_cleaning_buffer: - video_uninitialize(); exit_without_cleaning_videodriver: - #ifdef CONFIG_EXAMPLES_CAMERA_OUTPUT_LCD nximage_finalize(); #endif - return ret; } diff --git a/examples/chrono/chrono_main.c b/examples/chrono/chrono_main.c index 11a77051b..a5b7b1a89 100644 --- a/examples/chrono/chrono_main.c +++ b/examples/chrono/chrono_main.c @@ -207,7 +207,6 @@ errout_with_fd: close(fd); errout: - printf("chrono_daemon: Terminating\n"); return EXIT_FAILURE; } diff --git a/examples/esp32_himem/esp32_himem_main.c b/examples/esp32_himem/esp32_himem_main.c index 2d5e49240..9ad728d08 100644 --- a/examples/esp32_himem/esp32_himem_main.c +++ b/examples/esp32_himem/esp32_himem_main.c @@ -58,7 +58,7 @@ static bool check_mem(void *mem, int len, int phys_addr) if (val != *p) { printf("check_mem: %x has 0x%08x expected 0x%08x\n", - phys_addr + ((char *) p - (char *) mem), *p, val); + phys_addr + ((char *)p - (char *)mem), *p, val); return false; } p++; diff --git a/examples/fboverlay/fboverlay_main.c b/examples/fboverlay/fboverlay_main.c index 362e72b2a..22133b13d 100644 --- a/examples/fboverlay/fboverlay_main.c +++ b/examples/fboverlay/fboverlay_main.c @@ -113,8 +113,8 @@ static uint16_t rgb565(uint32_t argb) ****************************************************************************/ #ifdef CONFIG_FB_CMAP -static void draw_rect8(FAR void *fbmem, FAR struct fb_overlayinfo_s * oinfo, - FAR const struct fb_area_s * area, uint8_t color) +static void draw_rect8(FAR void *fbmem, FAR struct fb_overlayinfo_s *oinfo, + FAR const struct fb_area_s *area, uint8_t color) { FAR uint8_t *dest; FAR uint8_t *row; @@ -152,8 +152,8 @@ static void draw_rect8(FAR void *fbmem, FAR struct fb_overlayinfo_s * oinfo, * ****************************************************************************/ -static void draw_rect16(FAR void *fbmem, FAR struct fb_overlayinfo_s * oinfo, - FAR const struct fb_area_s * area, uint16_t rgb) +static void draw_rect16(FAR void *fbmem, FAR struct fb_overlayinfo_s *oinfo, + FAR const struct fb_area_s *area, uint16_t rgb) { FAR uint16_t *dest; FAR uint8_t *row; @@ -190,8 +190,8 @@ static void draw_rect16(FAR void *fbmem, FAR struct fb_overlayinfo_s * oinfo, * ****************************************************************************/ -static void draw_rect24(FAR void *fbmem, FAR struct fb_overlayinfo_s * oinfo, - FAR const struct fb_area_s * area, uint32_t rgb) +static void draw_rect24(FAR void *fbmem, FAR struct fb_overlayinfo_s *oinfo, + FAR const struct fb_area_s *area, uint32_t rgb) { int x; int y; @@ -238,8 +238,8 @@ static void draw_rect24(FAR void *fbmem, FAR struct fb_overlayinfo_s * oinfo, * ****************************************************************************/ -static void draw_rect32(FAR void *fbmem, FAR struct fb_overlayinfo_s * oinfo, - FAR const struct fb_area_s * area, uint32_t argb) +static void draw_rect32(FAR void *fbmem, FAR struct fb_overlayinfo_s *oinfo, + FAR const struct fb_area_s *area, uint32_t argb) { int x; int y; @@ -501,7 +501,7 @@ static void print_overlay_info(int fb, uint8_t overlayno) ****************************************************************************/ static int overlay_fill(int fb, uint8_t overlayno, uint32_t color, - FAR const struct fb_area_s * area) + FAR const struct fb_area_s *area) { int ret; FAR void *fbmem; diff --git a/examples/flash_test/flash_test.c b/examples/flash_test/flash_test.c index b62b04e7d..6d9df98c3 100644 --- a/examples/flash_test/flash_test.c +++ b/examples/flash_test/flash_test.c @@ -48,7 +48,7 @@ int main(int argc, FAR char *argv[]) { - struct inode * inode; + struct inode *inode; int ret; int x; int logsector; @@ -73,7 +73,7 @@ int main(int argc, FAR char *argv[]) if (ret < 0) { fprintf(stderr, "Failed to open %s\n", argv[1]); - goto errout; + return ret; } /* Get the low-level format from the device. */ @@ -113,14 +113,14 @@ int main(int argc, FAR char *argv[]) /* Allocate buffers to use */ - buffer = (char *) malloc(fmt.availbytes); + buffer = (char *)malloc(fmt.availbytes); if (buffer == NULL) { fprintf(stderr, "Error allocating buffer\n"); goto errout_with_driver; } - seqs = (uint16_t *) malloc(fmt.nsectors << 1); + seqs = (uint16_t *)malloc(fmt.nsectors << 1); if (seqs == NULL) { free(buffer); @@ -128,7 +128,7 @@ int main(int argc, FAR char *argv[]) goto errout_with_driver; } - sectors = (uint16_t *) malloc(fmt.nsectors << 1); + sectors = (uint16_t *)malloc(fmt.nsectors << 1); if (sectors == NULL) { free(seqs); @@ -167,7 +167,7 @@ int main(int argc, FAR char *argv[]) readwrite.logsector = sectors[x]; readwrite.offset = 0; readwrite.count = strlen(buffer) + 1; - readwrite.buffer = (uint8_t *) buffer; + readwrite.buffer = (uint8_t *)buffer; inode->u.i_bops->ioctl(inode, BIOC_WRITESECT, (unsigned long) &readwrite); @@ -188,7 +188,7 @@ int main(int argc, FAR char *argv[]) readwrite.logsector = sectors[x]; readwrite.offset = 0; readwrite.count = fmt.availbytes; - readwrite.buffer = (uint8_t *) buffer; + readwrite.buffer = (uint8_t *)buffer; ret = inode->u.i_bops->ioctl(inode, BIOC_READSECT, (unsigned long) &readwrite); @@ -229,7 +229,7 @@ int main(int argc, FAR char *argv[]) readwrite.logsector = sectors[x]; readwrite.offset = 0; readwrite.count = strlen(buffer) + 1; - readwrite.buffer = (uint8_t *) buffer; + readwrite.buffer = (uint8_t *)buffer; inode->u.i_bops->ioctl(inode, BIOC_WRITESECT, (unsigned long) &readwrite); @@ -256,7 +256,7 @@ int main(int argc, FAR char *argv[]) readwrite.logsector = sectors[x]; readwrite.offset = 64; readwrite.count = strlen(buffer) + 1; - readwrite.buffer = (uint8_t *) buffer; + readwrite.buffer = (uint8_t *)buffer; inode->u.i_bops->ioctl(inode, BIOC_WRITESECT, (unsigned long) &readwrite); @@ -293,8 +293,5 @@ errout_with_driver: /* Now close the block device and exit */ close_blockdriver(inode); - -errout: - return 0; } diff --git a/examples/foc/foc_intf.c b/examples/foc/foc_intf.c index 45edfa212..13fe1b6e8 100644 --- a/examples/foc/foc_intf.c +++ b/examples/foc/foc_intf.c @@ -588,7 +588,7 @@ int foc_intf_init(void) #endif #ifdef FOC_HAVE_INTF - errout: +errout: #endif return ret; @@ -636,7 +636,7 @@ int foc_intf_deinit(void) #endif #ifdef FOC_HAVE_INTF - errout: +errout: #endif return ret; @@ -686,7 +686,7 @@ int foc_intf_update(FAR struct foc_intf_data_s *data) #endif #ifdef FOC_HAVE_INTF - errout: +errout: #endif return ret; diff --git a/examples/foc/foc_main.c b/examples/foc/foc_main.c index c3a4d1e79..a675ccd58 100644 --- a/examples/foc/foc_main.c +++ b/examples/foc/foc_main.c @@ -621,10 +621,8 @@ errout: } errout_no_mutex: - foc_threads_deinit(); PRINTF("foc_main exit\n"); - return 0; } diff --git a/examples/foc/foc_thr.c b/examples/foc/foc_thr.c index c10b2606a..a510e8297 100644 --- a/examples/foc/foc_thr.c +++ b/examples/foc/foc_thr.c @@ -203,7 +203,6 @@ errout: } PRINTFV("foc_control_thr %d exit\n", envp->id); - return NULL; } diff --git a/examples/ipforward/ipforward.c b/examples/ipforward/ipforward.c index b6e082b11..3b346f412 100644 --- a/examples/ipforward/ipforward.c +++ b/examples/ipforward/ipforward.c @@ -766,7 +766,7 @@ int main(int argc, FAR char *argv[]) if (ret < 0) { fprintf(stderr, "ERROR: Failed to create tun0: %d\n", ret); - goto errout; + return ret; } ret = ipfwd_netconfig(&fwd.if_tun0, g_tun0_laddr, g_netmask); @@ -848,6 +848,5 @@ errout_with_tun1: close(fwd.if_tun1.it_fd); errout_with_tun0: close(fwd.if_tun0.it_fd); -errout: return errcode; } diff --git a/examples/mlx90614/mlx90614_main.c b/examples/mlx90614/mlx90614_main.c index 601545211..dfb95602a 100644 --- a/examples/mlx90614/mlx90614_main.c +++ b/examples/mlx90614/mlx90614_main.c @@ -109,7 +109,8 @@ int main(int argc, FAR char *argv[]) if (buffer[0] != '0' && buffer[1] != 'x') { - fprintf(stderr, "You need to pass the I2C address in hexa: 0xNN\n"); + fprintf(stderr, + "You need to pass the I2C address in hexa: 0xNN\n"); goto out; } @@ -121,10 +122,13 @@ int main(int argc, FAR char *argv[]) goto out; } - ret = ioctl(fd, SNIOC_CHANGE_SMBUSADDR, (unsigned long)((uintptr_t)&newaddr)); + ret = ioctl(fd, SNIOC_CHANGE_SMBUSADDR, + (unsigned long)((uintptr_t)&newaddr)); if (ret < 0) { - fprintf(stderr, "ERROR: ioctl(SNIOC_CHANGE_SMBUSADDR) failed: %d\n", errno); + fprintf(stderr, + "ERROR: ioctl(SNIOC_CHANGE_SMBUSADDR) failed: %d\n", + errno); goto out; } @@ -161,7 +165,6 @@ int main(int argc, FAR char *argv[]) } out: - close(fd); return 0; } diff --git a/examples/powerled/powerled_main.c b/examples/powerled/powerled_main.c index 05edd594a..1d2e2a683 100644 --- a/examples/powerled/powerled_main.c +++ b/examples/powerled/powerled_main.c @@ -753,7 +753,6 @@ int main(int argc, char *argv[]) } errout: - fflush(stdout); fflush(stderr); diff --git a/examples/smps/smps_main.c b/examples/smps/smps_main.c index 5cdb0bd27..f6815f54c 100644 --- a/examples/smps/smps_main.c +++ b/examples/smps/smps_main.c @@ -615,7 +615,6 @@ int main(int argc, char *argv[]) } errout: - if (fd > 0) { printf("Stop smps driver\n"); diff --git a/examples/tcpecho/tcpecho_main.c b/examples/tcpecho/tcpecho_main.c index f320aec31..3f39f5345 100644 --- a/examples/tcpecho/tcpecho_main.c +++ b/examples/tcpecho/tcpecho_main.c @@ -79,7 +79,7 @@ static int tcpecho_server(void); * Private Functions ****************************************************************************/ -static int tcpecho_netsetup() +static int tcpecho_netsetup(void) { /* If this task is excecutated as an NSH built-in function, then the * network has already been configured by NSH's start-up logic. diff --git a/examples/webserver/cgi.c b/examples/webserver/cgi.c index 38f40668a..c27f9e631 100644 --- a/examples/webserver/cgi.c +++ b/examples/webserver/cgi.c @@ -61,6 +61,10 @@ HTTPD_CGI_CALL(file, "file-stats", file_stats); HTTPD_CGI_CALL(net, "net-stats", net_stats); #endif +/**************************************************************************** + * Private Functions + ****************************************************************************/ + /**************************************************************************** * Name: net_stats ****************************************************************************/ @@ -106,11 +110,15 @@ static void file_stats(struct httpd_state *pstate, char *ptr) } #endif +/**************************************************************************** + * Public Functions + ****************************************************************************/ + /**************************************************************************** * Name: cgi_register ****************************************************************************/ -void cgi_register() +void cgi_register(void) { #ifdef CONFIG_NETUTILS_HTTPDFILESTATS httpd_cgi_register(&file); diff --git a/include/netutils/telnetc.h b/include/netutils/telnetc.h index 66e9bc0b2..f084238fe 100644 --- a/include/netutils/telnetc.h +++ b/include/netutils/telnetc.h @@ -705,7 +705,7 @@ void telnet_newenviron_value(struct telnet_s *telnet, unsigned char type, * ****************************************************************************/ -void telnet_ttype_send(struct telnet_s * telnet); +void telnet_ttype_send(struct telnet_s *telnet); /**************************************************************************** * Name: telnet_ttype_is @@ -743,7 +743,7 @@ void telnet_ttype_send(struct telnet_s * telnet); * ****************************************************************************/ -void telnet_ttype_is(struct telnet_s * telnet, const char *ttype); +void telnet_ttype_is(struct telnet_s *telnet, const char *ttype); /**************************************************************************** * Name: telnet_send_zmp @@ -758,8 +758,8 @@ void telnet_ttype_is(struct telnet_s * telnet, const char *ttype); * ****************************************************************************/ -void telnet_send_zmp(struct telnet_s * telnet, size_t argc, - const char **argv); +void telnet_send_zmp(struct telnet_s *telnet, size_t argc, + const char **argv); /**************************************************************************** * Name: telnet_send_zmpv @@ -775,7 +775,7 @@ void telnet_send_zmp(struct telnet_s * telnet, size_t argc, * ****************************************************************************/ -void telnet_send_zmpv(struct telnet_s * telnet, ...); +void telnet_send_zmpv(struct telnet_s *telnet, ...); /**************************************************************************** * Name: telnet_send_vzmpv @@ -787,7 +787,7 @@ void telnet_send_zmpv(struct telnet_s * telnet, ...); * ****************************************************************************/ -void telnet_send_vzmpv(struct telnet_s * telnet, va_list va); +void telnet_send_vzmpv(struct telnet_s *telnet, va_list va); /**************************************************************************** * Name: telnet_begin_zmp @@ -801,7 +801,7 @@ void telnet_send_vzmpv(struct telnet_s * telnet, va_list va); * ****************************************************************************/ -void telnet_begin_zmp(struct telnet_s * telnet, const char *cmd); +void telnet_begin_zmp(struct telnet_s *telnet, const char *cmd); /**************************************************************************** * Name: telnet_zmp_arg @@ -815,7 +815,7 @@ void telnet_begin_zmp(struct telnet_s * telnet, const char *cmd); * ****************************************************************************/ -void telnet_zmp_arg(struct telnet_s * telnet, const char *arg); +void telnet_zmp_arg(struct telnet_s *telnet, const char *arg); /**************************************************************************** * Name: telnet_finish_zmp diff --git a/industry/foc/fixed16/foc_handler.c b/industry/foc/fixed16/foc_handler.c index 5cc95d23f..8c77da167 100644 --- a/industry/foc/fixed16/foc_handler.c +++ b/industry/foc/fixed16/foc_handler.c @@ -298,7 +298,6 @@ errout: /* Set duty to zeros */ memset(out->duty, 0, sizeof(b16_t) * CONFIG_MOTOR_FOC_PHASES); - return ret; } diff --git a/industry/foc/fixed16/foc_svm3.c b/industry/foc/fixed16/foc_svm3.c index bfc3ab072..63ec4f7b2 100644 --- a/industry/foc/fixed16/foc_svm3.c +++ b/industry/foc/fixed16/foc_svm3.c @@ -120,7 +120,7 @@ static int foc_modulation_init_b16(FAR foc_handler_b16_t *h) goto errout; } - errout: +errout: return ret; } diff --git a/industry/foc/float/foc_handler.c b/industry/foc/float/foc_handler.c index e436e5ece..c767cf1e0 100644 --- a/industry/foc/float/foc_handler.c +++ b/industry/foc/float/foc_handler.c @@ -298,7 +298,6 @@ errout: /* Set duty to zeros */ memset(out->duty, 0, sizeof(float) * CONFIG_MOTOR_FOC_PHASES); - return ret; } diff --git a/interpreters/quickjs/qjsmini.c b/interpreters/quickjs/qjsmini.c index 6979e95a6..18957f939 100644 --- a/interpreters/quickjs/qjsmini.c +++ b/interpreters/quickjs/qjsmini.c @@ -372,7 +372,7 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename) js_free(ctx, buf); else free(buf); - fail: +fail: fclose(f); return NULL; } diff --git a/netutils/codecs/md5.c b/netutils/codecs/md5.c index 694e50f60..93133b27e 100644 --- a/netutils/codecs/md5.c +++ b/netutils/codecs/md5.c @@ -183,7 +183,7 @@ void md5_update(struct md5_context_s *ctx, unsigned char const *buf, memcpy(p, buf, t); byte_reverse(ctx->in, 16); - md5_transform(ctx->buf, (uint32_t *) ctx->in); + md5_transform(ctx->buf, (uint32_t *)ctx->in); buf += t; len -= t; } @@ -194,7 +194,7 @@ void md5_update(struct md5_context_s *ctx, unsigned char const *buf, { memcpy(ctx->in, buf, 64); byte_reverse(ctx->in, 16); - md5_transform(ctx->buf, (uint32_t *) ctx->in); + md5_transform(ctx->buf, (uint32_t *)ctx->in); buf += 64; len -= 64; } @@ -241,7 +241,7 @@ void md5_final(unsigned char digest[16], struct md5_context_s *ctx) memset(p, 0, count); byte_reverse(ctx->in, 16); - md5_transform(ctx->buf, (uint32_t *) ctx->in); + md5_transform(ctx->buf, (uint32_t *)ctx->in); /* Now fill the next block with 56 bytes */ @@ -261,7 +261,7 @@ void md5_final(unsigned char digest[16], struct md5_context_s *ctx) ((uint32_t *)ctx->in)[14] = ctx->bits[0]; ((uint32_t *)ctx->in)[15] = ctx->bits[1]; - md5_transform(ctx->buf, (uint32_t *) ctx->in); + md5_transform(ctx->buf, (uint32_t *)ctx->in); byte_reverse((unsigned char *)ctx->buf, 4); memcpy(digest, ctx->buf, 16); memset(ctx, 0, sizeof(struct md5_context_s)); /* In case it's sensitive */ diff --git a/netutils/discover/discover.c b/netutils/discover/discover.c index a45699d75..7613f17a7 100644 --- a/netutils/discover/discover.c +++ b/netutils/discover/discover.c @@ -136,7 +136,7 @@ static inline void discover_initresponse(void); * Private Functions ****************************************************************************/ -static inline void discover_initresponse() +static inline void discover_initresponse(void) { int chk = 0; int i; @@ -283,7 +283,7 @@ static inline int discover_respond(in_addr_t *ipaddr) return ret; } -static inline int discover_socket() +static inline int discover_socket(void) { int sockfd; #if defined(HAVE_SO_REUSEADDR) || defined(HAVE_SO_BROADCAST) @@ -329,7 +329,7 @@ static inline int discover_socket() return sockfd; } -static inline int discover_openlistener() +static inline int discover_openlistener(void) { struct sockaddr_in addr; struct ifreq req; diff --git a/netutils/libcurl4nx/curl4nx_easy_init.c b/netutils/libcurl4nx/curl4nx_easy_init.c index 2016ea67b..0fd3d6aec 100644 --- a/netutils/libcurl4nx/curl4nx_easy_init.c +++ b/netutils/libcurl4nx/curl4nx_easy_init.c @@ -43,7 +43,7 @@ * Name: curl4nx_easy_init() ****************************************************************************/ -FAR struct curl4nx_s * curl4nx_easy_init(void) +FAR struct curl4nx_s *curl4nx_easy_init(void) { FAR struct curl4nx_s *handle = malloc(sizeof(struct curl4nx_s)); diff --git a/netutils/netlib/netlib_getifstatus.c b/netutils/netlib/netlib_getifstatus.c index 0105a1621..378a0bec1 100644 --- a/netutils/netlib/netlib_getifstatus.c +++ b/netutils/netlib/netlib_getifstatus.c @@ -69,7 +69,7 @@ int netlib_getifstatus(FAR const char *ifname, FAR uint8_t *flags) if (sockfd >= 0) { struct ifreq req; - memset (&req, 0, sizeof(struct ifreq)); + memset(&req, 0, sizeof(struct ifreq)); /* Put the driver name into the request */ diff --git a/netutils/netlib/netlib_getmacaddr.c b/netutils/netlib/netlib_getmacaddr.c index 46b799be3..4a0b7bce7 100644 --- a/netutils/netlib/netlib_getmacaddr.c +++ b/netutils/netlib/netlib_getmacaddr.c @@ -68,7 +68,7 @@ int netlib_getmacaddr(const char *ifname, uint8_t *macaddr) if (sockfd >= 0) { struct ifreq req; - memset (&req, 0, sizeof(struct ifreq)); + memset(&req, 0, sizeof(struct ifreq)); /* Put the driver name into the request */ diff --git a/netutils/netlib/netlib_setifstatus.c b/netutils/netlib/netlib_setifstatus.c index 8ed30fa9f..0c54277df 100644 --- a/netutils/netlib/netlib_setifstatus.c +++ b/netutils/netlib/netlib_setifstatus.c @@ -67,7 +67,7 @@ int netlib_ifup(const char *ifname) if (sockfd >= 0) { struct ifreq req; - memset (&req, 0, sizeof(struct ifreq)); + memset(&req, 0, sizeof(struct ifreq)); /* Put the driver name into the request */ @@ -110,7 +110,7 @@ int netlib_ifdown(const char *ifname) if (sockfd >= 0) { struct ifreq req; - memset (&req, 0, sizeof(struct ifreq)); + memset(&req, 0, sizeof(struct ifreq)); /* Put the driver name into the request */ diff --git a/netutils/pppd/ipcp.c b/netutils/pppd/ipcp.c index 9aa2ed372..3f1768f3a 100644 --- a/netutils/pppd/ipcp.c +++ b/netutils/pppd/ipcp.c @@ -62,8 +62,8 @@ * Private Types ****************************************************************************/ -/* In the future add compression protocol and name servers (possibly for servers - * only) +/* In the future add compression protocol and name servers (possibly for + * servers only) */ static const uint8_t g_ipcplist[] = @@ -137,6 +137,7 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer, switch (*bptr++) { case CONF_REQ: + /* Parse request and see if we can ACK it */ ++bptr; @@ -146,7 +147,7 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer, /* len-=2; */ DEBUG1(("check lcplist\n")); - if (scan_packet(ctx, IPCP, g_ipcplist, buffer, bptr, (uint16_t)(len - 4))) + if (scan_packet(ctx, IPCP, g_ipcplist, buffer, bptr, len - 4)) { DEBUG1(("option was bad\n")); } @@ -160,8 +161,8 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer, /* Reject any protocol not */ - /* Error? if we we need to send a config Reject ++++ this is good for - * a subroutine. + /* Error? if we we need to send a config Reject ++++ this is good + * for a subroutine. */ /* All we should get is the peer IP address */ @@ -202,7 +203,7 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer, *bptr++ = CONF_NAK; /* Write Conf_rej */ *bptr++; - /* tptr++; *//* skip over ID */ + /* tptr++; */ /* skip over ID */ /* Write new length */ @@ -219,8 +220,9 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer, { } #endif - /* If we get here then we are OK, lets send an ACK and tell the rest - * of our modules our negotiated config. + + /* If we get here then we are OK, lets send an ACK and tell the + * rest of our modules our negotiated config. */ ctx->ipcp_state |= IPCP_RX_UP; @@ -269,6 +271,7 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer, switch (*bptr++) { case IPCP_IPADDRESS: + /* Dump length */ bptr++; @@ -338,6 +341,7 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer, switch (*bptr++) { case IPCP_IPADDRESS: + /* Dump length */ bptr++; @@ -456,7 +460,8 @@ void ipcp_task(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer) * request */ - if (!(ctx->ipcp_state & IPCP_TX_UP) && !(ctx->ipcp_state & IPCP_TX_TIMEOUT)) + if (!(ctx->ipcp_state & IPCP_TX_UP) && + !(ctx->ipcp_state & IPCP_TX_TIMEOUT)) { /* Check if we have a request pending */ @@ -466,7 +471,7 @@ void ipcp_task(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer) /* No pending request, lets build one */ - pkt = (IPCPPKT *) buffer; + pkt = (IPCPPKT *)buffer; /* Configure-Request only here, write id */ diff --git a/netutils/pppd/lcp.c b/netutils/pppd/lcp.c index ae6fcb770..069e4327a 100644 --- a/netutils/pppd/lcp.c +++ b/netutils/pppd/lcp.c @@ -122,6 +122,7 @@ void lcp_rx(struct ppp_context_s *ctx, uint8_t * buffer, uint16_t count) switch (*bptr++) { case CONF_REQ: /* config request */ + /* Parse request and see if we can ACK it */ id = *bptr++; @@ -191,14 +192,14 @@ void lcp_rx(struct ppp_context_s *ctx, uint8_t * buffer, uint16_t count) { /* OK */ - DEBUG1((", assume 0xffffffff", j)); + DEBUG1((", assume all ones", j)); ctx->ahdlc_flags &= ~PPP_TX_ASYNC_MAP; } else { /* Fail. We only support default or all zeros */ - DEBUG1(("We only support default or all zeros for ACCM ")); + DEBUG1(("We only support default or all zeros ACCM ")); error = 1; *tptr++ = LPC_ACCM; *tptr++ = 0x6; @@ -236,9 +237,9 @@ void lcp_rx(struct ppp_context_s *ctx, uint8_t * buffer, uint16_t count) case LPC_MAGICNUMBER: DEBUG1((" ")); - /* Compare incoming number to our number (not implemented) */ + /* Compare incoming number to our number */ - bptr++; /* For now just dump */ + bptr++; /* For now just dump */ bptr++; bptr++; bptr++; @@ -259,8 +260,8 @@ void lcp_rx(struct ppp_context_s *ctx, uint8_t * buffer, uint16_t count) } } - /* Error? if we we need to send a config Reject ++++ this is good for - * a subroutine. + /* Error? if we we need to send a config Reject ++++ this is good + * for a subroutine. */ if (error) @@ -282,7 +283,9 @@ void lcp_rx(struct ppp_context_s *ctx, uint8_t * buffer, uint16_t count) DEBUG1(("\nWriting NAK frame\n")); - /* Send packet ahdlc_txz(procol,header,data,headerlen,datalen); */ + /* Send packet: + * ahdlc_txz(procol,header,data,headerlen,datalen); + */ ahdlc_tx(ctx, LCP, 0, buffer, 0, (uint16_t)(tptr - buffer)); DEBUG1(("- end NAK Write frame\n")); @@ -309,7 +312,9 @@ void lcp_rx(struct ppp_context_s *ctx, uint8_t * buffer, uint16_t count) DEBUG2(("Writing ACK frame\n")); - /* Send packet ahdlc_txz(procol,header,data,headerlen,datalen); */ + /* Send packet: + * ahdlc_txz(procol,header,data,headerlen,datalen); + */ ahdlc_tx(ctx, LCP, 0, buffer, 0, count /* bptr-buffer */); DEBUG2(("- end ACK Write frame\n")); @@ -444,7 +449,7 @@ void lcp_echo_request(struct ppp_context_s *ctx) { ctx->lcp_prev_seconds = ppp_arch_clock_seconds(); - pkt = (LCPPKT *) buffer; + pkt = (LCPPKT *)buffer; /* Configure-Request only here, write id */ @@ -507,7 +512,7 @@ void lcp_task(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer) /* No pending request, lets build one */ - pkt = (LCPPKT *) buffer; + pkt = (LCPPKT *)buffer; /* Configure-Request only here, write id */ diff --git a/netutils/pppd/pap.c b/netutils/pppd/pap.c index 4ee7dd5c7..879f2251a 100644 --- a/netutils/pppd/pap.c +++ b/netutils/pppd/pap.c @@ -150,7 +150,7 @@ void pap_task(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer) /* Build a PAP request packet */ - pkt = (PAPPKT *) buffer; + pkt = (PAPPKT *)buffer; /* Configure-Request only here, write id */ diff --git a/netutils/pppd/ppp.c b/netutils/pppd/ppp.c index 4325dc3a9..12a2349fe 100644 --- a/netutils/pppd/ppp.c +++ b/netutils/pppd/ppp.c @@ -107,7 +107,7 @@ static void ppp_reject_protocol(FAR struct ppp_context_s *ctx, *--dptr = *--sptr; } - pkt = (LCPPKT *) buffer; + pkt = (LCPPKT *)buffer; pkt->code = PROT_REJ; /* Write Conf_rej */ /* pkt->id = tid++; write tid */ diff --git a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c index 4298a2100..6cd3c8b32 100644 --- a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c +++ b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c @@ -446,7 +446,6 @@ static int usrsock_rpmsg_sendto_handler(struct rpmsg_endpoint *ept, } out: - if (ret > 0 && usrsock_rpmsg_available(&priv->socks[req->usockid], FIONSPACE)) { diff --git a/netutils/webserver/httpd_dirlist.c b/netutils/webserver/httpd_dirlist.c index fde1190b7..8ab1a3f10 100644 --- a/netutils/webserver/httpd_dirlist.c +++ b/netutils/webserver/httpd_dirlist.c @@ -241,7 +241,6 @@ ssize_t httpd_dirlist(int outfd, FAR struct httpd_fs_file *file) closedir(dir); errout_with_hdr: - memset(&info, 0, sizeof(info)); uname(&info); @@ -262,7 +261,6 @@ errout_with_hdr: ret = total; errout: - free(tmp); return ret; } diff --git a/netutils/xmlrpc/response.c b/netutils/xmlrpc/response.c index 171c348a7..d274abf6d 100644 --- a/netutils/xmlrpc/response.c +++ b/netutils/xmlrpc/response.c @@ -40,8 +40,7 @@ * POSSIBILITY OF SUCH DAMAGE. ****************************************************************************/ -/* - * Lightweight Embedded XML-RPC Server Response Generator +/* Lightweight Embedded XML-RPC Server Response Generator * * mtj@cogitollc.com * @@ -61,9 +60,12 @@ * Private Functions ****************************************************************************/ -static int xmlrpc_insertlength(struct xmlrpc_s * xmlcall) +static int xmlrpc_insertlength(struct xmlrpc_s *xmlcall) { - int len, digit, xdigit = 1000, i = 0; + int xdigit = 1000; + int i = 0; + int len; + int digit; char *temp; temp = strstr(xmlcall->response, "response[strlen(xmlcall->response)], " \n"); - isStruct = 1; + isstruct = 1; break; case '}': sprintf(&xmlcall->response[strlen(xmlcall->response)], " \n"); - isStruct = 0; + isstruct = 0; break; case 'i': @@ -246,7 +251,6 @@ int xmlrpc_buildresponse(struct xmlrpc_s* xmlcall, char *args, ...) default: return (XMLRPC_BAD_RESPONSE_ARG); break; - } if (close) @@ -263,7 +267,8 @@ int xmlrpc_buildresponse(struct xmlrpc_s* xmlcall, char *args, ...) if (xmlcall->error) { - strcat(&xmlcall->response[strlen(xmlcall->response)], " \r\n"); + strcat(&xmlcall->response[strlen(xmlcall->response)], + " \r\n"); } else { diff --git a/netutils/xmlrpc/xmlparser.c b/netutils/xmlrpc/xmlparser.c index 63b57257d..7405e8168 100644 --- a/netutils/xmlrpc/xmlparser.c +++ b/netutils/xmlrpc/xmlparser.c @@ -40,8 +40,7 @@ * POSSIBILITY OF SUCH DAMAGE. ****************************************************************************/ -/* - * Lightweight Embedded XML-RPC Server XML Parser +/* Lightweight Embedded XML-RPC Server XML Parser * * mtj@cogitollc.com * @@ -71,22 +70,22 @@ ****************************************************************************/ static struct xmlrpc_s g_xmlcall; -static char g_data[CONFIG_XMLRPC_STRINGSIZE+1]; +static char g_data[CONFIG_XMLRPC_STRINGSIZE + 1]; static struct xmlrpc_entry_s *g_entries = NULL; -static const char *errorStrings[] = +static const char *g_error_strings[] = { - /* 0 */ "Internal error (unknown)", - /* 1 */ "Parse Error...", - /* 2 */ "Function not found...", - /* 3 */ "Unexpected Integer Argument...", - /* 4 */ "Unexpected Boolean Argument...", - /* 5 */ "Unexpected Double Argument...", - /* 6 */ "Unexpected String Argument...", - /* 7 */ "Bad Response Argument..." + "Internal error (unknown)", + "Parse Error...", + "Function not found...", + "Unexpected Integer Argument...", + "Unexpected Boolean Argument...", + "Unexpected Double Argument...", + "Unexpected String Argument...", + "Bad Response Argument..." }; -#define MAX_ERROR_CODE (sizeof(errorStrings)/sizeof(char *)) +#define MAX_ERROR_CODE (sizeof(g_error_strings)/sizeof(char *)) struct parsebuf_s { @@ -99,7 +98,7 @@ struct parsebuf_s * Private Functions ****************************************************************************/ -static int xmlrpc_call(struct xmlrpc_s * call) +static int xmlrpc_call(struct xmlrpc_s *call) { int ret = XMLRPC_NO_SUCH_FUNCTION; struct xmlrpc_entry_s *entry = g_entries; @@ -120,7 +119,7 @@ static int xmlrpc_call(struct xmlrpc_s * call) return ret; } -static int xmlrpc_getelement(struct parsebuf_s * pbuf, char *data, int dataSize) +static int xmlrpc_getelement(struct parsebuf_s *pbuf, char *data, int size) { int j = 0; int ret = XMLRPC_NO_ERROR; @@ -146,7 +145,7 @@ static int xmlrpc_getelement(struct parsebuf_s * pbuf, char *data, int dataSize) data[j++] = pbuf->buf[pbuf->index++]; - while (j < dataSize) + while (j < size) { if (pbuf->buf[pbuf->index] == '>') { @@ -161,7 +160,7 @@ static int xmlrpc_getelement(struct parsebuf_s * pbuf, char *data, int dataSize) else { data[j++] = pbuf->buf[pbuf->index++]; - if (j >= dataSize) + if (j >= size) { ret = XMLRPC_PARSE_ERROR; } @@ -172,7 +171,7 @@ static int xmlrpc_getelement(struct parsebuf_s * pbuf, char *data, int dataSize) return ret; } -static int xmlrpc_parseparam(struct parsebuf_s * pbuf) +static int xmlrpc_parseparam(struct parsebuf_s *pbuf) { int type; @@ -273,9 +272,10 @@ static int xmlrpc_parseparam(struct parsebuf_s * pbuf) return XMLRPC_NO_ERROR; } -static int xmlrpc_parseparams(struct parsebuf_s * pbuf) +static int xmlrpc_parseparams(struct parsebuf_s *pbuf) { - int type, ret = XMLRPC_PARSE_ERROR; + int ret = XMLRPC_PARSE_ERROR; + int type; /* First, look for the params tag */ @@ -305,9 +305,10 @@ static int xmlrpc_parseparams(struct parsebuf_s * pbuf) return ret; } -static int xmlrpc_parsemethod(struct parsebuf_s * pbuf) +static int xmlrpc_parsemethod(struct parsebuf_s *pbuf) { - int type, ret = XMLRPC_PARSE_ERROR; + int ret = XMLRPC_PARSE_ERROR; + int type; memset((void *)&g_xmlcall, 0, sizeof(struct xmlrpc_s)); @@ -348,8 +349,8 @@ static void xmlrpc_sendfault(int fault) fault = 0; } - xmlrpc_buildresponse(&g_xmlcall, "{is}", - "faultCode", fault, "faultString", errorStrings[fault]); + xmlrpc_buildresponse(&g_xmlcall, "{is}", "faultCode", + fault, "faultString", g_error_strings[fault]); } /**************************************************************************** diff --git a/system/hexed/src/hexinsert.c b/system/hexed/src/hexinsert.c index e0c1e3711..377ea1a01 100644 --- a/system/hexed/src/hexinsert.c +++ b/system/hexed/src/hexinsert.c @@ -5,7 +5,8 @@ * Copyright (c) 2011, B.ZaaR, 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: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. @@ -18,7 +19,7 @@ * products derived from this software without specific prior written * permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS & 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 @@ -51,7 +52,8 @@ static int runinsert(FAR struct command_s *cmd) { - long dest, rpt; + long dest; + long rpt; /* Default to a 0 (zero) value for 1 count */ @@ -108,6 +110,7 @@ static int setinsert(FAR struct command_s *cmd, int optc, char *opt) switch (optc) { case 0: + /* Set destination */ cmd->opts.dest = v; @@ -115,6 +118,7 @@ static int setinsert(FAR struct command_s *cmd, int optc, char *opt) break; case 1: + /* Set count (len) */ cmd->opts.len = v; @@ -122,6 +126,7 @@ static int setinsert(FAR struct command_s *cmd, int optc, char *opt) break; default: + /* Set values */ if (optc > 1 && cmd->opts.cnt < OPT_BUF_SZ) @@ -134,20 +139,21 @@ static int setinsert(FAR struct command_s *cmd, int optc, char *opt) break; case WORD_32: - *((int32_t *) hx + cmd->opts.cnt) = v; + *((int32_t *)hx + cmd->opts.cnt) = v; break; case WORD_16: - *((int16_t *) hx + cmd->opts.cnt) = v; + *((int16_t *)hx + cmd->opts.cnt) = v; break; case WORD_8: - *((int8_t *) hx + cmd->opts.cnt) = v; + *((int8_t *)hx + cmd->opts.cnt) = v; break; default: break; } + cmd->opts.cnt++; optc++; diff --git a/system/i2c/i2c_dev.c b/system/i2c/i2c_dev.c index d14738658..87bd499da 100644 --- a/system/i2c/i2c_dev.c +++ b/system/i2c/i2c_dev.c @@ -174,7 +174,6 @@ int i2ccmd_dev(FAR struct i2ctool_s *i2ctool, int argc, char **argv) close(fd); errout: - /* Restore the previous "sticky" register address unless a new register * address was provided on the command line. In that case the new * register address is retained. diff --git a/system/i2c/i2c_hexdump.c b/system/i2c/i2c_hexdump.c index cdb342054..5d48ba783 100644 --- a/system/i2c/i2c_hexdump.c +++ b/system/i2c/i2c_hexdump.c @@ -111,7 +111,7 @@ void i2ctool_hexdump(FILE *outstream, void *addr, int len) { /* print address */ - fprintf(outstream, "%08tx ", p - (uint8_t *) addr); + fprintf(outstream, "%08tx ", p - (uint8_t *)addr); /* print one line of data */ diff --git a/system/nxlooper/nxlooper.c b/system/nxlooper/nxlooper.c index 8a6dd9b1d..86ede96ff 100644 --- a/system/nxlooper/nxlooper.c +++ b/system/nxlooper/nxlooper.c @@ -1135,7 +1135,6 @@ int nxlooper_loopraw(FAR struct nxlooper_s *plooper, return OK; err_out: - #ifdef CONFIG_AUDIO_MULTI_SESSION ioctl(plooper->playdev_fd, AUDIOIOC_RELEASE, (unsigned long)plooper->pplayses); @@ -1144,7 +1143,6 @@ err_out: #endif err_out_record: - #ifdef CONFIG_AUDIO_MULTI_SESSION ioctl(plooper->recorddev_fd, AUDIOIOC_RELEASE, (unsigned long)plooper->precordses); @@ -1153,7 +1151,6 @@ err_out_record: #endif err_out_dev: - close(plooper->playdev_fd); plooper->playdev_fd = -1; close(plooper->recorddev_fd); diff --git a/system/nxplayer/nxplayer.c b/system/nxplayer/nxplayer.c index e7048c957..7c09fa7dd 100644 --- a/system/nxplayer/nxplayer.c +++ b/system/nxplayer/nxplayer.c @@ -752,7 +752,7 @@ static int nxplayer_enqueuebuffer(FAR struct nxplayer_s *pplayer, static void *nxplayer_playthread(pthread_addr_t pvarg) { - struct nxplayer_s *pplayer = (struct nxplayer_s *) pvarg; + struct nxplayer_s *pplayer = (struct nxplayer_s *)pvarg; struct audio_msg_s msg; struct audio_buf_desc_s buf_desc; ssize_t size; diff --git a/system/nxrecorder/nxrecorder.c b/system/nxrecorder/nxrecorder.c index aa1abca9f..b1527b82b 100644 --- a/system/nxrecorder/nxrecorder.c +++ b/system/nxrecorder/nxrecorder.c @@ -225,7 +225,7 @@ static int nxrecorder_enqueuebuffer(FAR struct nxrecorder_s *precorder, static void *nxrecorder_recordthread(pthread_addr_t pvarg) { - struct nxrecorder_s *precorder = (struct nxrecorder_s *) pvarg; + struct nxrecorder_s *precorder = (struct nxrecorder_s *)pvarg; struct audio_msg_s msg; struct audio_buf_desc_s buf_desc; ssize_t size; diff --git a/system/vi/vi.c b/system/vi/vi.c index 805314605..7baff382d 100644 --- a/system/vi/vi.c +++ b/system/vi/vi.c @@ -307,7 +307,7 @@ struct vi_s struct vi_pos_s cursor; /* Current cursor position */ struct vi_pos_s cursave; /* Saved cursor position */ struct vi_pos_s display; /* Display size */ - FAR struct termcurses_s * tcurs; + FAR struct termcurses_s *tcurs; off_t curpos; /* The current cursor offset into the text buffer */ off_t textsize; /* The size of the text buffer */ off_t winpos; /* Offset corresponding to the start of the display */ diff --git a/testing/mtd_config_fs/mtd_config_fs_test_main.c b/testing/mtd_config_fs/mtd_config_fs_test_main.c index b11b9351c..2d8c36631 100644 --- a/testing/mtd_config_fs/mtd_config_fs_test_main.c +++ b/testing/mtd_config_fs/mtd_config_fs_test_main.c @@ -352,10 +352,7 @@ static void test_nvs_mount(struct mtdnvs_ctx_s *ctx) return; test_fail: - printf("%s: failed\n", __func__); - - return; } /**************************************************************************** @@ -472,10 +469,7 @@ static void test_nvs_write(struct mtdnvs_ctx_s *ctx) return; test_fail: - printf("%s: failed\n", __func__); - - return; } /**************************************************************************** @@ -648,16 +642,17 @@ static void test_nvs_corrupt_expire(struct mtdnvs_ctx_s *ctx) return; test_fail: - if (mtd_fd >= 0) - close(mtd_fd); + { + close(mtd_fd); + } if (nvs_fd >= 0) - close(nvs_fd); + { + close(nvs_fd); + } printf("%s: failed\n", __func__); - - return; } /**************************************************************************** @@ -808,7 +803,6 @@ static void test_nvs_corrupted_write(struct mtdnvs_ctx_s *ctx) return; test_fail: - printf("%s: failed\n", __func__); if (nvs_fd > 0) { @@ -819,8 +813,6 @@ test_fail: { close(mtd_fd); } - - return; } /**************************************************************************** @@ -975,16 +967,15 @@ static void test_nvs_gc(struct mtdnvs_ctx_s *ctx) } printf("%s: success\n", __func__); - return; test_fail: if (fd >= 0) - close(fd); + { + close(fd); + } printf("%s: failed\n", __func__); - - return; } /**************************************************************************** @@ -1033,7 +1024,9 @@ static int write_content(uint16_t max_id, uint16_t begin, uint16_t end) test_fail: if (fd >= 0) - close(fd); + { + close(fd); + } return ret; } @@ -1090,9 +1083,10 @@ static int check_content(uint16_t max_id) return ret; test_fail: - if (fd >= 0) - close(fd); + { + close(fd); + } return ret; } @@ -1284,14 +1278,10 @@ static void test_nvs_gc_3sectors(struct mtdnvs_ctx_s *ctx) } printf("%s: success\n", __func__); - return; test_fail: - printf("%s: failed\n", __func__); - - return; } /**************************************************************************** @@ -1473,20 +1463,20 @@ static void test_nvs_corrupted_sector_close(struct mtdnvs_ctx_s *ctx) } printf("%s: success\n", __func__); - return; test_fail: - if (nvs_fd >= 0) - close(nvs_fd); + { + close(nvs_fd); + } if (mtd_fd >= 0) - close(mtd_fd); + { + close(mtd_fd); + } printf("%s: failed\n", __func__); - - return; } /**************************************************************************** @@ -1638,17 +1628,15 @@ static void test_nvs_full_sector(struct mtdnvs_ctx_s *ctx) } printf("%s: success\n", __func__); - return; test_fail: - if (fd >= 0) - close(fd); + { + close(fd); + } printf("%s: failed\n", __func__); - - return; } /**************************************************************************** @@ -1828,20 +1816,20 @@ static void test_nvs_gc_corrupt_close_ate(struct mtdnvs_ctx_s *ctx) } printf("%s: success\n", __func__); - return; test_fail: - if (nvs_fd >= 0) - close(nvs_fd); + { + close(nvs_fd); + } if (mtd_fd >= 0) - close(mtd_fd); + { + close(mtd_fd); + } printf("%s: failed\n", __func__); - - return; } /**************************************************************************** @@ -1966,17 +1954,15 @@ static void test_nvs_gc_corrupt_ate(struct mtdnvs_ctx_s *ctx) } printf("%s: success\n", __func__); - return; test_fail: - if (mtd_fd >= 0) - close(mtd_fd); + { + close(mtd_fd); + } printf("%s: failed\n", __func__); - - return; } /**************************************************************************** @@ -2125,7 +2111,6 @@ test_fail: } printf("%s: failed\n", __func__); - return; } /**************************************************************************** @@ -2303,7 +2288,6 @@ test_fail: } printf("%s: failed\n", __func__); - return; } /**************************************************************************** @@ -2461,7 +2445,6 @@ test_fail: } printf("%s: failed\n", __func__); - return; } /**************************************************************************** diff --git a/testing/ostest/pthread_rwlock.c b/testing/ostest/pthread_rwlock.c index b88456d1f..dc079535c 100644 --- a/testing/ostest/pthread_rwlock.c +++ b/testing/ostest/pthread_rwlock.c @@ -273,7 +273,7 @@ static void test_two_threads(void) static void * timeout_thread1(FAR void * data) { - FAR struct race_cond_s * rc = (FAR struct race_cond_s *) data; + FAR struct race_cond_s *rc = (FAR struct race_cond_s *)data; int status; status = pthread_rwlock_wrlock(rc->rw_lock); @@ -297,7 +297,7 @@ static void * timeout_thread1(FAR void * data) static void * timeout_thread2(FAR void * data) { - FAR struct race_cond_s * rc = (FAR struct race_cond_s *) data; + FAR struct race_cond_s *rc = (FAR struct race_cond_s *)data; struct timespec time; int status; diff --git a/testing/ostest/pthread_rwlock_cancel.c b/testing/ostest/pthread_rwlock_cancel.c index c19832611..24700296e 100644 --- a/testing/ostest/pthread_rwlock_cancel.c +++ b/testing/ostest/pthread_rwlock_cancel.c @@ -42,7 +42,7 @@ struct sync_s static void * timeout_thread1(FAR void * data) { - FAR struct sync_s * sync = (FAR struct sync_s *) data; + FAR struct sync_s *sync = (FAR struct sync_s *)data; struct timespec time; int status; @@ -64,7 +64,7 @@ static void * timeout_thread1(FAR void * data) static void * timeout_thread2(FAR void * data) { - FAR struct sync_s * sync = (FAR struct sync_s *) data; + FAR struct sync_s *sync = (FAR struct sync_s *)data; struct timespec time; int status; diff --git a/wireless/gs2200m/gs2200m_main.c b/wireless/gs2200m/gs2200m_main.c index fa1002740..83f425f91 100644 --- a/wireless/gs2200m/gs2200m_main.c +++ b/wireless/gs2200m/gs2200m_main.c @@ -861,7 +861,6 @@ static int sendto_request(int fd, FAR struct gs2200m_s *priv, } prepare: - if (sendbuf) { free(sendbuf); @@ -1031,7 +1030,6 @@ prepare: } err_out: - gs2200m_printf("%s: *** end ret=%d\n", __func__, ret); if (rmsg.buf) @@ -1803,7 +1801,6 @@ int main(int argc, FAR char *argv[]) ret = gs2200m_loop(_daemon); errout: - if (_daemon) { free(_daemon);