diff --git a/arch/arm/src/cxd56xx/cxd56_adc.c b/arch/arm/src/cxd56xx/cxd56_adc.c index b06fa91ccc..c634574b1a 100644 --- a/arch/arm/src/cxd56xx/cxd56_adc.c +++ b/arch/arm/src/cxd56xx/cxd56_adc.c @@ -173,7 +173,7 @@ struct cxd56adc_dev_s uint8_t fifomode; /* fifo mode */ struct scufifo_wm_s *wm; /* water mark */ struct math_filter_s *filter; /* math filter */ - struct scuev_notify_s * notify; /* notify */ + struct scuev_notify_s *notify; /* notify */ mutex_t lock; /* exclusive mutex */ int crefs; /* reference count */ }; diff --git a/arch/arm/src/cxd56xx/cxd56_dmac.c b/arch/arm/src/cxd56xx/cxd56_dmac.c index a54c245786..f0a0649976 100644 --- a/arch/arm/src/cxd56xx/cxd56_dmac.c +++ b/arch/arm/src/cxd56xx/cxd56_dmac.c @@ -292,6 +292,10 @@ struct dma_channel_s static struct dma_channel_s g_dmach[NCHANNELS]; static mutex_t g_dmalock = NXMUTEX_INITIALIZER; +/**************************************************************************** + * Private Functions + ****************************************************************************/ + static int dma_init(int ch); static int dma_uninit(int ch); static int dma_open(int ch); @@ -328,6 +332,7 @@ static struct dmac_register_map *get_device(int ch) case 2: return (struct dmac_register_map *)DMAC2_REG_BASE; case 3: return (struct dmac_register_map *)DMAC3_REG_BASE; } + return NULL; } @@ -335,15 +340,17 @@ static struct dmac_ch_register_map *get_channel(int ch) { struct dmac_register_map *dev = get_device(ch); if (dev == NULL) - return NULL; + { + return NULL; + } if (is_dmac(2, dev)) { - return &dev->channel[ch - 7]; + return &dev->channel[ch - 7]; } else if (is_dmac(3, dev)) { - return &((struct dmac080_register_map *)dev)->channel[ch - 2]; + return &((struct dmac080_register_map *)dev)->channel[ch - 2]; } return &dev->channel[ch & 1]; @@ -397,12 +404,12 @@ static void _dmac_intc_handler(int ch) if (is_dmac(2, dev)) { - mask = 1u << (ch - 7); + mask = 1u << (ch - 7); } else if (is_dmac(3, dev)) { - mask = 1u << (ch - 2); + mask = 1u << (ch - 2); } itc = dev->inttcstatus & mask; diff --git a/arch/arm/src/cxd56xx/cxd56_emmc.c b/arch/arm/src/cxd56xx/cxd56_emmc.c index dfb72a25a9..174e079c21 100644 --- a/arch/arm/src/cxd56xx/cxd56_emmc.c +++ b/arch/arm/src/cxd56xx/cxd56_emmc.c @@ -271,7 +271,7 @@ static struct emmc_dma_desc_s *emmc_setupdma(void *buf, unsigned int nbytes) int i; int ndescs; struct emmc_dma_desc_s *descs; - struct emmc_dma_desc_s *d; + struct emmc_dma_desc_s *d; uint32_t addr; uint32_t size; unsigned int remain; @@ -935,13 +935,11 @@ static int cxd56_emmc_geometry(struct inode *inode, int cxd56_emmcinitialize(void) { - struct cxd56_emmc_state_s *priv; + struct cxd56_emmc_state_s *priv = &g_emmcdev; uint8_t *buf; struct emmc_dma_desc_s *descs; int ret; - priv = &g_emmcdev; - ret = emmc_hwinitialize(); if (ret != OK) { diff --git a/arch/arm/src/cxd56xx/cxd56_geofence.c b/arch/arm/src/cxd56xx/cxd56_geofence.c index 572f3188c0..b861a1d10a 100644 --- a/arch/arm/src/cxd56xx/cxd56_geofence.c +++ b/arch/arm/src/cxd56xx/cxd56_geofence.c @@ -399,7 +399,7 @@ static int cxd56_geofence_get_all_status(unsigned long arg) static int cxd56_geofence_set_mode(unsigned long arg) { - int ret; + int ret; struct cxd56_geofence_mode_s *mode; if (!arg) @@ -550,7 +550,7 @@ static int cxd56_geofence_poll(struct file *filep, struct pollfd *fds, bool setup) { - struct inode * inode; + struct inode *inode; struct cxd56_geofence_dev_s *priv; int ret = OK; int i; diff --git a/arch/arm/src/cxd56xx/cxd56_gnss.c b/arch/arm/src/cxd56xx/cxd56_gnss.c index 3c346f0029..744746f305 100644 --- a/arch/arm/src/cxd56xx/cxd56_gnss.c +++ b/arch/arm/src/cxd56xx/cxd56_gnss.c @@ -161,7 +161,7 @@ struct cxd56_gnss_dev_s uint8_t num_open; uint8_t notify_data; struct file cepfp; - void * cepbuf; + void *cepbuf; struct pollfd *fds[CONFIG_CXD56_GNSS_NPOLLWAITERS]; #if CONFIG_CXD56_GNSS_NSIGNALRECEIVERS != 0 struct cxd56_gnss_sig_s sigs[CONFIG_CXD56_GNSS_NSIGNALRECEIVERS]; @@ -1884,8 +1884,8 @@ static int cxd56_gnss_select_rtk_satellite(struct file *filep, static int cxd56_gnss_get_rtk_satellite(struct file *filep, unsigned long arg) { - int ret; - uint32_t gnss = 0; + int ret; + uint32_t gnss = 0; if (!arg) { @@ -2688,7 +2688,7 @@ static int cxd56_gnss_initialize(struct cxd56_gnss_dev_s *dev) static int cxd56_gnss_open(struct file *filep) { - struct inode * inode; + struct inode *inode; struct cxd56_gnss_dev_s *priv; int ret = OK; int retry = 50; @@ -2795,7 +2795,7 @@ success: static int cxd56_gnss_close(struct file *filep) { - struct inode * inode; + struct inode *inode; struct cxd56_gnss_dev_s *priv; int ret = OK; @@ -2937,7 +2937,7 @@ static ssize_t cxd56_gnss_write(struct file *filep, static int cxd56_gnss_ioctl(struct file *filep, int cmd, unsigned long arg) { - struct inode * inode; + struct inode *inode; struct cxd56_gnss_dev_s *priv; int ret; diff --git a/arch/arm/src/cxd56xx/cxd56_hostif.c b/arch/arm/src/cxd56xx/cxd56_hostif.c index d9cc850e4f..ec217d03bd 100644 --- a/arch/arm/src/cxd56xx/cxd56_hostif.c +++ b/arch/arm/src/cxd56xx/cxd56_hostif.c @@ -442,9 +442,7 @@ static int hif_initialize(struct hostif_buff_s *buffer) cxd56_iccinit(CXD56_PROTO_HOSTIF); - ret = cxd56_iccregisterhandler(CXD56_PROTO_HOSTIF, hif_rxhandler, NULL); - - return ret; + return cxd56_iccregisterhandler(CXD56_PROTO_HOSTIF, hif_rxhandler, NULL); } /**************************************************************************** diff --git a/arch/arm/src/cxd56xx/cxd56_sdhci.c b/arch/arm/src/cxd56xx/cxd56_sdhci.c index 9c442356a5..92b6b36276 100644 --- a/arch/arm/src/cxd56xx/cxd56_sdhci.c +++ b/arch/arm/src/cxd56xx/cxd56_sdhci.c @@ -261,8 +261,8 @@ struct cxd56_sdiodev_s bool usedma; bool dmasend_prepare; size_t receive_size; - uint8_t *aligned_buffer; /* Used to buffer alignment */ - uint8_t *receive_buffer; /* Used to keep receive buffer address */ + uint8_t *aligned_buffer; /* Used to buffer alignment */ + uint8_t *receive_buffer; /* Used to keep receive buffer address */ uint32_t dma_cmd; uint32_t dmasend_cmd; uint32_t dmasend_regcmd; @@ -2795,7 +2795,7 @@ static int cxd56_sdio_dmarecvsetup(struct sdio_dev_s *dev, { struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev; unsigned int blocksize; - int ret = OK; + int ret = OK; DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0); DEBUGASSERT(((uint32_t)buffer & 3) == 0); diff --git a/arch/arm/src/cxd56xx/cxd56_spi.c b/arch/arm/src/cxd56xx/cxd56_spi.c index e1df6b3d03..bc33926de3 100644 --- a/arch/arm/src/cxd56xx/cxd56_spi.c +++ b/arch/arm/src/cxd56xx/cxd56_spi.c @@ -178,9 +178,9 @@ static const struct spi_ops_s g_spi4ops = static struct cxd56_spidev_s g_spi4dev = { .spidev = - { - &g_spi4ops - }, + { + .ops = &g_spi4ops, + }, .spibase = CXD56_IMG_SPI_BASE, .spibasefreq = 0, .port = 4, @@ -225,9 +225,9 @@ static const struct spi_ops_s g_spi5ops = static struct cxd56_spidev_s g_spi5dev = { .spidev = - { - &g_spi5ops - }, + { + .ops = &g_spi5ops, + }, .spibase = CXD56_IMG_WSPI_BASE, .spibasefreq = 0, .port = 5, @@ -271,9 +271,9 @@ static const struct spi_ops_s g_spi0ops = static struct cxd56_spidev_s g_spi0dev = { .spidev = - { - &g_spi0ops - }, + { + .ops = &g_spi0ops, + }, .spibase = CXD56_SPIM_BASE, .spibasefreq = 0, .port = 0, @@ -317,9 +317,9 @@ static const struct spi_ops_s g_spi3ops = static struct cxd56_spidev_s g_spi3dev = { .spidev = - { - &g_spi3ops - }, + { + .ops = &g_spi3ops, + }, .spibase = CXD56_SCU_SPI_BASE, .spibasefreq = 0, .port = 3, diff --git a/arch/arm/src/cxd56xx/cxd56_uart0.c b/arch/arm/src/cxd56xx/cxd56_uart0.c index 6a7f55a68d..e7c13b7679 100644 --- a/arch/arm/src/cxd56xx/cxd56_uart0.c +++ b/arch/arm/src/cxd56xx/cxd56_uart0.c @@ -231,15 +231,7 @@ static ssize_t uart0_write(struct file *filep, int cxd56_uart0initialize(const char *devname) { - int ret; - - ret = register_driver(devname, &g_uart0fops, 0666, NULL); - if (ret != 0) - { - return ERROR; - } - - return OK; + return register_driver(devname, &g_uart0fops, 0666, NULL); } /**************************************************************************** diff --git a/arch/arm/src/efm32/efm32_i2c.c b/arch/arm/src/efm32/efm32_i2c.c index 844ce20686..4f5b93810f 100644 --- a/arch/arm/src/efm32/efm32_i2c.c +++ b/arch/arm/src/efm32/efm32_i2c.c @@ -742,7 +742,7 @@ static void efm32_i2c_setclock(struct efm32_i2c_priv_s *priv, #elif defined(CONFIG_EFM32_I2C_CLHR_ASYMMETRIC) # define n (6 + 3) /* Ratio is 6:3 */ #else /* CLHR STANDARD */ -# define n ( 4 + 4) /* Ratio is 4:4 */ +# define n (4 + 4) /* Ratio is 4:4 */ #endif div = (BOARD_HFPERCLK_FREQUENCY - (4 * frequency)) / (n * frequency); diff --git a/arch/arm/src/efm32/efm32_usbhost.c b/arch/arm/src/efm32/efm32_usbhost.c index 258ece1f09..5567735f22 100644 --- a/arch/arm/src/efm32/efm32_usbhost.c +++ b/arch/arm/src/efm32/efm32_usbhost.c @@ -494,8 +494,8 @@ static struct efm32_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = efm32_wait, - .enumerate = efm32_enumerate, + .wait = efm32_wait, + .enumerate = efm32_enumerate, }; #ifdef HAVE_USBHOST_TRACE @@ -5280,7 +5280,7 @@ static inline void efm32_sw_initialize(struct efm32_usbhost_s *priv) struct efm32_chan_s *chan = &priv->chan[i]; chan->chidx = i; - nxsem_init(&chan->waitsem, 0, 0); + nxsem_init(&chan->waitsem, 0, 0); } } diff --git a/arch/arm/src/gd32f4/gd32f4xx_dma.c b/arch/arm/src/gd32f4/gd32f4xx_dma.c index 67cdef1481..56131405d3 100644 --- a/arch/arm/src/gd32f4/gd32f4xx_dma.c +++ b/arch/arm/src/gd32f4/gd32f4xx_dma.c @@ -176,7 +176,7 @@ static struct gd32_dma_channel_s g_dmachan[DMA_NCHANNELS] = .chan_num = GD32_DMA_CH6, .irq = GD32_IRQ_DMA1_CHANNEL6, .chsem = SEM_INITIALIZER(1), - .dmabase = GD32_DMA1, + .dmabase = GD32_DMA1, }, { .chan_num = GD32_DMA_CH7, diff --git a/arch/arm/src/gd32f4/gd32f4xx_spi.c b/arch/arm/src/gd32f4/gd32f4xx_spi.c index 75c941c5ab..198bc7e9dc 100644 --- a/arch/arm/src/gd32f4/gd32f4xx_spi.c +++ b/arch/arm/src/gd32f4/gd32f4xx_spi.c @@ -293,9 +293,9 @@ static uint8_t g_spi0_rxbuf[SPI0_DMA_BUFSIZE_ADJ] SPI_DMA_BUFEER_ALIGN; static struct gd32_spidev_s g_spi0dev = { .spidev = - { - &g_spi0ops - }, + { + .ops = &g_spi0ops + }, .spibase = GD32_SPI0, .spiclock = GD32_PCLK2_FREQUENCY, .lock = NXMUTEX_INITIALIZER, @@ -1451,12 +1451,12 @@ static void spi_exchange_nodma(struct spi_dev_s *dev, struct gd32_spidev_s *priv = (struct gd32_spidev_s *)dev; DEBUGASSERT(priv && priv->spibase); - uint8_t *brxptr = (uint8_t *)rxbuffer; - const uint8_t *btxptr = (uint8_t *)txbuffer; - uint16_t *wrxptr = (uint16_t *)rxbuffer; - const uint16_t *wtxptr = (const uint16_t *)txbuffer; - uint8_t byte; - uint16_t word; + uint8_t *brxptr = (uint8_t *)rxbuffer; + const uint8_t *btxptr = (uint8_t *)txbuffer; + uint16_t *wrxptr = (uint16_t *)rxbuffer; + const uint16_t *wtxptr = (const uint16_t *)txbuffer; + uint8_t byte; + uint16_t word; spiinfo("txbuffer=%p rxbuffer=%p nwords=%d\n", txbuffer, rxbuffer, nwords); diff --git a/arch/arm/src/imx1/imx_spi.c b/arch/arm/src/imx1/imx_spi.c index 080bcb946d..043e41d898 100644 --- a/arch/arm/src/imx1/imx_spi.c +++ b/arch/arm/src/imx1/imx_spi.c @@ -207,23 +207,23 @@ static struct imx_spidev_s g_spidev[] = { #ifdef CONFIG_IMX1_SPI1 { - .ops = &g_spiops, - .base = IMX_CSPI1_VBASE, + .ops = &g_spiops, + .base = IMX_CSPI1_VBASE, .lock = NXMUTEX_INITIALIZER, #ifndef CONFIG_SPI_POLLWAIT .waitsem = SEM_INITIALIZER(0), - .irq = IMX_IRQ_CSPI1, + .irq = IMX_IRQ_CSPI1, #endif }, #endif #ifdef CONFIG_IMX1_SPI2 { - .ops = &g_spiops, - .base = IMX_CSPI2_VBASE, + .ops = &g_spiops, + .base = IMX_CSPI2_VBASE, .lock = NXMUTEX_INITIALIZER, #ifndef CONFIG_SPI_POLLWAIT .waitsem = SEM_INITIALIZER(0), - .irq = IMX_IRQ_CSPI2, + .irq = IMX_IRQ_CSPI2, #endif }, #endif diff --git a/arch/arm/src/imxrt/imxrt_ehci.c b/arch/arm/src/imxrt/imxrt_ehci.c index 4e2bd8edf3..6918f12670 100644 --- a/arch/arm/src/imxrt/imxrt_ehci.c +++ b/arch/arm/src/imxrt/imxrt_ehci.c @@ -592,7 +592,7 @@ static struct imxrt_qh_s g_asynchead aligned_data(32); #ifndef CONFIG_USBHOST_INT_DISABLE /* The head of the periodic queue */ -static struct imxrt_qh_s g_intrhead aligned_data(32); +static struct imxrt_qh_s g_intrhead aligned_data(32); /* The frame list */ @@ -4978,21 +4978,21 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller) /* Sanity checks */ DEBUGASSERT(controller == 0); - DEBUGASSERT(((uintptr_t) & g_asynchead & 0x1f) == 0); + DEBUGASSERT(((uintptr_t)&g_asynchead & 0x1f) == 0); DEBUGASSERT((sizeof(struct imxrt_qh_s) & 0x1f) == 0); DEBUGASSERT((sizeof(struct imxrt_qtd_s) & 0x1f) == 0); # ifdef CONFIG_IMXRT_EHCI_PREALLOCATE - DEBUGASSERT(((uintptr_t) & g_qhpool & 0x1f) == 0); - DEBUGASSERT(((uintptr_t) & g_qtdpool & 0x1f) == 0); + DEBUGASSERT(((uintptr_t)&g_qhpool & 0x1f) == 0); + DEBUGASSERT(((uintptr_t)&g_qtdpool & 0x1f) == 0); # endif # ifndef CONFIG_USBHOST_INT_DISABLE - DEBUGASSERT(((uintptr_t) & g_intrhead & 0x1f) == 0); + DEBUGASSERT(((uintptr_t)&g_intrhead & 0x1f) == 0); # ifdef CONFIG_IMXRT_EHCI_PREALLOCATE - DEBUGASSERT(((uintptr_t) g_framelist & 0xfff) == 0); + DEBUGASSERT(((uintptr_t)g_framelist & 0xfff) == 0); # endif -# endif /* CONFIG_USBHOST_INT_DISABLE */ +# endif /* CONFIG_USBHOST_INT_DISABLE */ /* Software Configuration *************************************************/ @@ -5199,7 +5199,7 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller) */ memset(&g_asynchead, 0, sizeof(struct imxrt_qh_s)); - physaddr = imxrt_physramaddr((uintptr_t) & g_asynchead); + physaddr = imxrt_physramaddr((uintptr_t)&g_asynchead); g_asynchead.hw.hlp = imxrt_swap32(physaddr | QH_HLP_TYP_QH); g_asynchead.hw.epchar = imxrt_swap32(QH_EPCHAR_H | QH_EPCHAR_EPS_FULL); g_asynchead.hw.overlay.nqp = imxrt_swap32(QH_NQP_T); @@ -5230,7 +5230,7 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller) /* Attach the periodic QH to Period Frame List */ - physaddr = imxrt_physramaddr((uintptr_t) & g_intrhead); + physaddr = imxrt_physramaddr((uintptr_t)&g_intrhead); for (i = 0; i < FRAME_LIST_SIZE; i++) { g_framelist[i] = imxrt_swap32(physaddr) | PFL_TYP_QH; diff --git a/arch/arm/src/imxrt/imxrt_enc.c b/arch/arm/src/imxrt/imxrt_enc.c index 2e6f201e7d..d1cc4f3ba5 100644 --- a/arch/arm/src/imxrt/imxrt_enc.c +++ b/arch/arm/src/imxrt/imxrt_enc.c @@ -1201,7 +1201,7 @@ static int imxrt_ioctl(struct qe_lowerhalf_s *lower, int cmd, int imxrt_qeinitialize(const char *devpath, int enc) { - struct imxrt_enc_lowerhalf_s * priv = NULL; + struct imxrt_enc_lowerhalf_s *priv = NULL; switch (enc) { diff --git a/arch/arm/src/imxrt/imxrt_flexspi.c b/arch/arm/src/imxrt/imxrt_flexspi.c index 070c6f5afb..7bf6c77425 100644 --- a/arch/arm/src/imxrt/imxrt_flexspi.c +++ b/arch/arm/src/imxrt/imxrt_flexspi.c @@ -112,7 +112,7 @@ static struct imxrt_flexspidev_s g_flexspi0dev = { .ops = &g_flexspi0ops, }, - .base = (struct flexspi_type_s *) IMXRT_FLEXSPIC_BASE, + .base = (struct flexspi_type_s *)IMXRT_FLEXSPIC_BASE, .lock = NXMUTEX_INITIALIZER, }; diff --git a/arch/arm/src/imxrt/imxrt_lpi2c.c b/arch/arm/src/imxrt/imxrt_lpi2c.c index 9225356cab..652e13da54 100644 --- a/arch/arm/src/imxrt/imxrt_lpi2c.c +++ b/arch/arm/src/imxrt/imxrt_lpi2c.c @@ -1070,7 +1070,7 @@ static void imxrt_lpi2c_setclock(struct imxrt_lpi2c_priv_s *priv, CCM_CSCDR2_LPI2C_CLK_PODF_SHIFT; lpi2c_clk_div = lpi2c_clk_div + 1; src_freq = (BOARD_XTAL_FREQUENCY * pll3_div) / - (8 * lpi2c_clk_div) ; + (8 * lpi2c_clk_div); } /* LPI2C output frequency = (Source Clock (Hz)/ 2^prescale) / @@ -1976,7 +1976,7 @@ static int imxrt_lpi2c_dma_transfer(struct imxrt_lpi2c_priv_s *priv) LPI2C_MIER_NDIE | LPI2C_MIER_ALIE | LPI2C_MIER_PLTIE | LPI2C_MIER_FEIE); - imxrt_dmach_start(priv->dma, imxrt_dma_callback, (void *)priv); + imxrt_dmach_start(priv->dma, imxrt_dma_callback, priv); imxrt_lpi2c_modifyreg(priv, IMXRT_LPI2C_MDER_OFFSET, 0, LPI2C_MDER_TDDE | LPI2C_MDER_RDDE); diff --git a/arch/arm/src/imxrt/imxrt_lpspi.c b/arch/arm/src/imxrt/imxrt_lpspi.c index c478a28048..c978d3fdbb 100644 --- a/arch/arm/src/imxrt/imxrt_lpspi.c +++ b/arch/arm/src/imxrt/imxrt_lpspi.c @@ -242,7 +242,7 @@ static struct imxrt_lpspidev_s g_lpspi1dev = { .spidev = { - &g_spi1ops + .ops = &g_spi1ops, }, .spibase = IMXRT_LPSPI1_BASE, #ifdef CONFIG_IMXRT_LPSPI_INTERRUPTS @@ -291,7 +291,7 @@ static struct imxrt_lpspidev_s g_lpspi2dev = { .spidev = { - &g_spi2ops + .ops = &g_spi2ops, }, .spibase = IMXRT_LPSPI2_BASE, #ifdef CONFIG_IMXRT_LPSPI_INTERRUPTS @@ -340,7 +340,7 @@ static struct imxrt_lpspidev_s g_lpspi3dev = { .spidev = { - &g_spi3ops + .ops = &g_spi3ops, }, .spibase = IMXRT_LPSPI3_BASE, #ifdef CONFIG_IMXRT_LPSPI_INTERRUPTS @@ -389,7 +389,7 @@ static struct imxrt_lpspidev_s g_lpspi4dev = { .spidev = { - &g_spi4ops + .ops = &g_spi4ops, }, .spibase = IMXRT_LPSPI4_BASE, #ifdef CONFIG_IMXRT_LPSPI_INTERRUPTS @@ -1310,8 +1310,8 @@ static void imxrt_lpspi_exchange_nodma(struct spi_dev_s *dev, { /* 16-bit mode */ - const uint16_t *src = (const uint16_t *)txbuffer; - uint16_t *dest = (uint16_t *) rxbuffer; + const uint16_t *src = txbuffer; + uint16_t *dest = rxbuffer; uint16_t word; while (nwords-- > 0) @@ -1343,8 +1343,8 @@ static void imxrt_lpspi_exchange_nodma(struct spi_dev_s *dev, { /* 8-bit mode */ - const uint8_t *src = (const uint8_t *)txbuffer; - uint8_t *dest = (uint8_t *) rxbuffer; + const uint8_t *src = txbuffer; + uint8_t *dest = rxbuffer; uint8_t word; while (nwords-- > 0) @@ -1362,7 +1362,7 @@ static void imxrt_lpspi_exchange_nodma(struct spi_dev_s *dev, /* Exchange one word */ - word = (uint8_t) imxrt_lpspi_send(dev, (uint32_t) word); + word = (uint8_t)imxrt_lpspi_send(dev, word); /* Is there a buffer to receive the return value? */ @@ -1396,16 +1396,16 @@ static void imxrt_lpspi_exchange_nodma(struct spi_dev_s *dev, ****************************************************************************/ #ifdef CONFIG_IMXRT_LPSPI_DMA -static void imxrt_lpspi_exchange(struct spi_dev_s * dev, - const void * txbuffer, - void * rxbuffer, size_t nwords) +static void imxrt_lpspi_exchange(struct spi_dev_s *dev, + const void *txbuffer, + void *rxbuffer, size_t nwords) { - int ret; - size_t adjust; - ssize_t nbytes; - static uint8_t rxdummy[4] aligned_data(4); - static const uint16_t txdummy = 0xffff; - uint32_t regval; + int ret; + size_t adjust; + ssize_t nbytes; + static uint8_t rxdummy[4] aligned_data(4); + static const uint16_t txdummy = 0xffff; + uint32_t regval; struct imxrt_lpspidev_s *priv = (struct imxrt_lpspidev_s *)dev; DEBUGASSERT(priv != NULL); diff --git a/arch/arm/src/imxrt/imxrt_serial.c b/arch/arm/src/imxrt/imxrt_serial.c index 3d24db6e00..8b166ee22d 100644 --- a/arch/arm/src/imxrt/imxrt_serial.c +++ b/arch/arm/src/imxrt/imxrt_serial.c @@ -1538,7 +1538,7 @@ static int imxrt_dma_setup(struct uart_dev_s *dev) * worth of time to claim bytes before they are overwritten. */ - imxrt_dmach_start(priv->rxdma, imxrt_dma_rxcallback, (void *)priv); + imxrt_dmach_start(priv->rxdma, imxrt_dma_rxcallback, priv); } #endif @@ -1866,7 +1866,7 @@ static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios *)arg; + struct termios *termiosp = (struct termios *)arg; struct imxrt_uart_s *priv = (struct imxrt_uart_s *)dev; if (!termiosp) @@ -1928,7 +1928,7 @@ static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios *)arg; + struct termios *termiosp = (struct termios *)arg; struct imxrt_uart_s *priv = (struct imxrt_uart_s *)dev; uint32_t baud; uint32_t ie; @@ -2398,7 +2398,7 @@ static void imxrt_dma_reenable(struct imxrt_uart_s *priv) * worth of time to claim bytes before they are overwritten. */ - imxrt_dmach_start(priv->rxdma, imxrt_dma_rxcallback, (void *)priv); + imxrt_dmach_start(priv->rxdma, imxrt_dma_rxcallback, priv); /* Clear DMA suspended flag. */ @@ -2569,7 +2569,7 @@ static void imxrt_dma_send(struct uart_dev_s *dev) /* Start transmission with the callback on DMA completion */ - imxrt_dmach_start(priv->txdma, imxrt_dma_txcallback, (void *)priv); + imxrt_dmach_start(priv->txdma, imxrt_dma_txcallback, priv); } #endif diff --git a/arch/arm/src/imxrt/imxrt_usdhc.c b/arch/arm/src/imxrt/imxrt_usdhc.c index 03aef2d8dc..236ef94462 100644 --- a/arch/arm/src/imxrt/imxrt_usdhc.c +++ b/arch/arm/src/imxrt/imxrt_usdhc.c @@ -950,7 +950,7 @@ static void imxrt_receive(struct imxrt_dev_s *priv) { /* Transfer any trailing fractional word */ - uint8_t *ptr = (uint8_t *) priv->buffer; + uint8_t *ptr = (uint8_t *)priv->buffer; int i; for (i = 0; i < priv->remaining; i++) @@ -2244,7 +2244,8 @@ static int imxrt_recvsetup(struct sdio_dev_s *dev, uint8_t *buffer, * handler and DMA memory invalidation. */ - priv->buffer = (uint32_t *) buffer; priv->remaining = nbytes; + priv->buffer = (uint32_t *)buffer; + priv->remaining = nbytes; /* Then set up the SDIO data path */ @@ -2292,7 +2293,8 @@ static int imxrt_sendsetup(struct sdio_dev_s *dev, /* Save the source buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t *) buffer; priv->remaining = nbytes; + priv->buffer = (uint32_t *)buffer; + priv->remaining = nbytes; /* Then set up the SDIO data path */ @@ -3039,7 +3041,7 @@ static int imxrt_dmasendsetup(struct sdio_dev_s *dev, # endif #endif - priv->buffer = (uint32_t *) buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; /* Then set up the SDIO data path */ diff --git a/arch/arm/src/kinetis/kinetis_spi.c b/arch/arm/src/kinetis/kinetis_spi.c index 7843d33ded..817b5103da 100644 --- a/arch/arm/src/kinetis/kinetis_spi.c +++ b/arch/arm/src/kinetis/kinetis_spi.c @@ -221,13 +221,13 @@ static const struct spi_ops_s g_spi0ops = static struct kinetis_spidev_s g_spi0dev = { - .spidev = + .spidev = { &g_spi0ops }, - .spibase = KINETIS_SPI0_BASE, + .spibase = KINETIS_SPI0_BASE, .lock = NXMUTEX_INITIALIZER, - .ctarsel = KINETIS_SPI_CTAR0_OFFSET, + .ctarsel = KINETIS_SPI_CTAR0_OFFSET, #ifdef CONFIG_KINETIS_SPI_DMA # ifdef CONFIG_KINETIS_SPI0_DMA .rxch = KINETIS_DMA_REQUEST_SRC_SPI0_RX, @@ -273,13 +273,13 @@ static const struct spi_ops_s g_spi1ops = static struct kinetis_spidev_s g_spi1dev = { - .spidev = + .spidev = { &g_spi1ops }, - .spibase = KINETIS_SPI1_BASE, + .spibase = KINETIS_SPI1_BASE, .lock = NXMUTEX_INITIALIZER, - .ctarsel = KINETIS_SPI_CTAR0_OFFSET, + .ctarsel = KINETIS_SPI_CTAR0_OFFSET, #ifdef CONFIG_KINETIS_SPI_DMA # ifdef CONFIG_KINETIS_SPI1_DMA .rxch = KINETIS_DMA_REQUEST_SRC_SPI1_RX, @@ -325,13 +325,13 @@ static const struct spi_ops_s g_spi2ops = static struct kinetis_spidev_s g_spi2dev = { - .spidev = + .spidev = { &g_spi2ops }, - .spibase = KINETIS_SPI2_BASE, + .spibase = KINETIS_SPI2_BASE, .lock = NXMUTEX_INITIALIZER, - .ctarsel = KINETIS_SPI_CTAR0_OFFSET, + .ctarsel = KINETIS_SPI_CTAR0_OFFSET, #ifdef CONFIG_KINETIS_SPI_DMA # ifdef CONFIG_KINETIS_SPI2_DMA .rxch = KINETIS_DMA_REQUEST_SRC_FTM3_CH6__SPI2_RX, @@ -1667,7 +1667,7 @@ struct spi_dev_s *kinetis_spibus_initialize(int port) /* select mode 0 */ - priv->mode = SPIDEV_MODE3; + priv->mode = SPIDEV_MODE3; spi_setmode(&priv->spidev, SPIDEV_MODE0); /* Select a default frequency of approx. 400KHz */ diff --git a/arch/arm/src/kinetis/kinetis_usbhshost.c b/arch/arm/src/kinetis/kinetis_usbhshost.c index fdf1baebaf..d4ea381e1b 100644 --- a/arch/arm/src/kinetis/kinetis_usbhshost.c +++ b/arch/arm/src/kinetis/kinetis_usbhshost.c @@ -4042,10 +4042,6 @@ static int kinetis_epalloc(struct usbhost_driver_s *drvr, epinfo->xfrtype = epdesc->xfrtype; epinfo->speed = hport->speed; - /* The iocsem semaphore is used for signaling and, hence, should not have - * priority inheritance enabled. - */ - nxsem_init(&epinfo->iocsem, 0, 0); /* Success.. return an opaque reference to the endpoint information @@ -5052,21 +5048,21 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller) /* Sanity checks */ DEBUGASSERT(controller == 0); - DEBUGASSERT(((uintptr_t) & g_asynchead & 0x1f) == 0); + DEBUGASSERT(((uintptr_t)&g_asynchead & 0x1f) == 0); DEBUGASSERT((sizeof(struct kinetis_qh_s) & 0x1f) == 0); DEBUGASSERT((sizeof(struct kinetis_qtd_s) & 0x1f) == 0); # ifdef CONFIG_KINETIS_EHCI_PREALLOCATE - DEBUGASSERT(((uintptr_t) & g_qhpool & 0x1f) == 0); - DEBUGASSERT(((uintptr_t) & g_qtdpool & 0x1f) == 0); + DEBUGASSERT(((uintptr_t)&g_qhpool & 0x1f) == 0); + DEBUGASSERT(((uintptr_t)&g_qtdpool & 0x1f) == 0); # endif # ifndef CONFIG_USBHOST_INT_DISABLE - DEBUGASSERT(((uintptr_t) & g_intrhead & 0x1f) == 0); + DEBUGASSERT(((uintptr_t)&g_intrhead & 0x1f) == 0); # ifdef CONFIG_KINETIS_EHCI_PREALLOCATE - DEBUGASSERT(((uintptr_t) g_framelist & 0xfff) == 0); + DEBUGASSERT(((uintptr_t)g_framelist & 0xfff) == 0); # endif -# endif /* CONFIG_USBHOST_INT_DISABLE */ +# endif /* CONFIG_USBHOST_INT_DISABLE */ /* Software Configuration *************************************************/ @@ -5300,7 +5296,7 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller) /* Attach the periodic QH to Period Frame List */ - physaddr = kinetis_physramaddr((uintptr_t) & g_intrhead); + physaddr = kinetis_physramaddr((uintptr_t)&g_intrhead); for (i = 0; i < FRAME_LIST_SIZE; i++) { g_framelist[i] = kinetis_swap32(physaddr) | PFL_TYP_QH; diff --git a/arch/arm/src/kl/kl_spi.c b/arch/arm/src/kl/kl_spi.c index 18e0777b14..26c026aab1 100644 --- a/arch/arm/src/kl/kl_spi.c +++ b/arch/arm/src/kl/kl_spi.c @@ -122,9 +122,9 @@ static const struct spi_ops_s g_spi0ops = static struct kl_spidev_s g_spi0dev = { .spidev = - { - &g_spi0ops - }, + { + .ops = &g_spi0ops + }, .spibase = KL_SPI0_BASE, .lock = NXMUTEX_INITIALIZER, }; @@ -155,9 +155,9 @@ static const struct spi_ops_s g_spi1ops = static struct kl_spidev_s g_spi1dev = { .spidev = - { - &g_spi1ops - }, + { + .ops = &g_spi1ops + }, .spibase = KL_SPI1_BASE, .lock = NXMUTEX_INITIALIZER, }; diff --git a/arch/arm/src/lc823450/lc823450_dma.c b/arch/arm/src/lc823450/lc823450_dma.c index 499bede1de..84f427723a 100644 --- a/arch/arm/src/lc823450/lc823450_dma.c +++ b/arch/arm/src/lc823450/lc823450_dma.c @@ -306,7 +306,7 @@ static void dma_done(DMA_HANDLE handle, void *arg, int result) test_done = 1; } -void lc823450_dma_test() +void lc823450_dma_test(void) { int i; for (i = 0; i < 256; i++) diff --git a/arch/arm/src/lc823450/lc823450_mtd.c b/arch/arm/src/lc823450/lc823450_mtd.c index c6277333b1..8d9f20c11b 100644 --- a/arch/arm/src/lc823450/lc823450_mtd.c +++ b/arch/arm/src/lc823450/lc823450_mtd.c @@ -815,7 +815,6 @@ int lc823450_mtd_uninitialize(uint32_t devno) DEBUGASSERT(ret == OK); nxmutex_destroy(&priv->lock); - kmm_free(g_mtdmaster[ch]); g_mtdmaster[ch] = NULL; diff --git a/arch/arm/src/lc823450/lc823450_sdc.c b/arch/arm/src/lc823450/lc823450_sdc.c index 7396903e02..bde7d69c3e 100644 --- a/arch/arm/src/lc823450/lc823450_sdc.c +++ b/arch/arm/src/lc823450/lc823450_sdc.c @@ -82,7 +82,7 @@ static mutex_t _sdc_lock[2] = { NXMUTEX_INITIALIZER, - NXMUTEX_INITIALIZER + NXMUTEX_INITIALIZER, }; static struct sddrcfg_s _sdch0; diff --git a/arch/arm/src/lc823450/lc823450_serial.c b/arch/arm/src/lc823450/lc823450_serial.c index 37836c9706..820a9462b9 100644 --- a/arch/arm/src/lc823450/lc823450_serial.c +++ b/arch/arm/src/lc823450/lc823450_serial.c @@ -168,7 +168,6 @@ struct up_dev_s DMA_HANDLE hrxdma; DMA_HANDLE htxdma; sem_t rxdma_wait; - sem_t rxpkt_wait; sem_t txdma_wait; #endif /* CONFIG_HSUART */ spinlock_t lock; @@ -1112,7 +1111,7 @@ static void uart_rxdma_callback(DMA_HANDLE hdma, void *arg, int result) * Name: up_hs_dmasetup ****************************************************************************/ -static void up_hs_dmasetup() +static void up_hs_dmasetup(void) { irqstate_t flags; diff --git a/arch/arm/src/lc823450/lc823450_spi.c b/arch/arm/src/lc823450/lc823450_spi.c index 3f1144c8fd..649ab1159b 100644 --- a/arch/arm/src/lc823450/lc823450_spi.c +++ b/arch/arm/src/lc823450/lc823450_spi.c @@ -73,7 +73,7 @@ struct lc823450_spidev_s #endif #ifdef CONFIG_LC823450_SPI_DMA DMA_HANDLE hdma; - sem_t dma_wait; + sem_t dma_wait; #endif /* CONFIG_LC823450_SPI_DMA */ }; @@ -127,9 +127,9 @@ static const struct spi_ops_s g_spiops = static struct lc823450_spidev_s g_spidev = { .spidev = - { - &g_spiops - }, + { + .ops = &g_spiops + }, #ifndef CONFIG_SPI_OWNBUS .lock = NXMUTEX_INITIALIZER, #endif diff --git a/arch/arm/src/lc823450/lc823450_usbdev.c b/arch/arm/src/lc823450/lc823450_usbdev.c index 2ba3860ba9..c5afeb3d60 100644 --- a/arch/arm/src/lc823450/lc823450_usbdev.c +++ b/arch/arm/src/lc823450/lc823450_usbdev.c @@ -560,7 +560,7 @@ static struct usbdev_req_s *lc823450_epallocreq(struct usbdev_ep_s *ep) usbtrace(TRACE_EPALLOCREQ, ((struct lc823450_ep_s *)ep)->epphy); privreq = (struct lc823450_req_s *) - kmm_malloc(sizeof(struct lc823450_req_s)); + kmm_zalloc(sizeof(struct lc823450_req_s)); if (!privreq) { @@ -568,7 +568,6 @@ static struct usbdev_req_s *lc823450_epallocreq(struct usbdev_ep_s *ep) return NULL; } - memset(privreq, 0, sizeof(struct lc823450_req_s)); return &privreq->req; } @@ -1710,7 +1709,7 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver) * Name: usbdev_msc_read_enter ****************************************************************************/ -void usbdev_msc_read_enter() +void usbdev_msc_read_enter(void) { struct lc823450_ep_s *privep; # ifdef CONFIG_DVFS @@ -1727,7 +1726,7 @@ void usbdev_msc_read_enter() * Name: usbdev_msc_read_exit ****************************************************************************/ -void usbdev_msc_read_exit() +void usbdev_msc_read_exit(void) { struct lc823450_ep_s *privep; diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c index cf57a0decc..252c9c9848 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c @@ -139,7 +139,7 @@ static void lpc17_40_stopnext(struct lpc17_40_i2cdev_s *priv); static int lpc17_40_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int lpc17_40_i2c_reset(struct i2c_master_s * dev); +static int lpc17_40_i2c_reset(struct i2c_master_s *dev); #endif /**************************************************************************** @@ -505,7 +505,7 @@ static int lpc17_40_i2c_interrupt(int irq, void *context, void *arg) ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int lpc17_40_i2c_reset(struct i2c_master_s * dev) +static int lpc17_40_i2c_reset(struct i2c_master_s *dev) { return OK; } @@ -651,9 +651,9 @@ struct i2c_master_s *lpc17_40_i2cbus_initialize(int port) * ****************************************************************************/ -int lpc17_40_i2cbus_uninitialize(struct i2c_master_s * dev) +int lpc17_40_i2cbus_uninitialize(struct i2c_master_s *dev) { - struct lpc17_40_i2cdev_s *priv = (struct lpc17_40_i2cdev_s *) dev; + struct lpc17_40_i2cdev_s *priv = (struct lpc17_40_i2cdev_s *)dev; /* Disable I2C */ diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_spi.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_spi.c index 88b3ee8be7..ba4b74aa50 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_spi.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_spi.c @@ -139,10 +139,10 @@ static const struct spi_ops_s g_spiops = static struct lpc17_40_spidev_s g_spidev = { .spidev = - { - &g_spiops - }, - .lock = NXMUTEX_INITIALIZER, + { + .ops = &g_spiops, + }, + .lock = NXMUTEX_INITIALIZER, }; /**************************************************************************** diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_ssp.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_ssp.c index f5977a4be7..0d84455143 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_ssp.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_ssp.c @@ -177,9 +177,9 @@ static const struct spi_ops_s g_spi0ops = static struct lpc17_40_sspdev_s g_ssp0dev = { .spidev = - { - &g_spi0ops - }, + { + .ops = &g_spi0ops, + }, .sspbase = LPC17_40_SSP0_BASE, #ifdef CONFIG_LPC17_40_SSP_INTERRUPTS .sspirq = LPC17_40_IRQ_SSP0, @@ -213,9 +213,9 @@ static const struct spi_ops_s g_spi1ops = static struct lpc17_40_sspdev_s g_ssp1dev = { .spidev = - { - &g_spi1ops - }, + { + .ops = &g_spi1ops, + }, .sspbase = LPC17_40_SSP1_BASE, #ifdef CONFIG_LPC17_40_SSP_INTERRUPTS .sspirq = LPC17_40_IRQ_SSP1, @@ -249,9 +249,9 @@ static const struct spi_ops_s g_spi2ops = static struct lpc17_40_sspdev_s g_ssp2dev = { .spidev = - { - &g_spi2ops - }, + { + .ops = &g_spi2ops, + }, .sspbase = LPC17_40_SSP2_BASE, #ifdef CONFIG_LPC17_40_SSP_INTERRUPTS .sspirq = LPC17_40_IRQ_SSP2, diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c index 116634245d..2db5d2e4ee 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c @@ -421,8 +421,8 @@ static struct lpc17_40_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = lpc17_40_wait, - .enumerate = lpc17_40_enumerate, + .wait = lpc17_40_wait, + .enumerate = lpc17_40_enumerate, }; /* This is a free list of EDs and TD buffers */ @@ -2665,7 +2665,7 @@ static int lpc17_40_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, struct lpc17_40_usbhost_s *priv = (struct lpc17_40_usbhost_s *)drvr; struct lpc17_40_ed_s *ed = (struct lpc17_40_ed_s *)ep0; uint16_t len; - int ret; + int ret; DEBUGASSERT(priv != NULL && ed != NULL && req != NULL); @@ -3634,7 +3634,7 @@ static inline void lpc17_40_ep0init(struct lpc17_40_usbhost_s *priv) /* Initialize the common tail TD. */ memset(TDTAIL, 0, sizeof(struct lpc17_40_gtd_s)); - TDTAIL->ed = EDCTRL; + TDTAIL->ed = EDCTRL; /* Link the common tail TD to the ED's TD list */ diff --git a/arch/arm/src/lpc2378/lpc23xx_i2c.c b/arch/arm/src/lpc2378/lpc23xx_i2c.c index d87c22101a..4db64c2c3e 100644 --- a/arch/arm/src/lpc2378/lpc23xx_i2c.c +++ b/arch/arm/src/lpc2378/lpc23xx_i2c.c @@ -145,7 +145,7 @@ static void lpc2378_stopnext(struct lpc2378_i2cdev_s *priv); static int lpc2378_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int lpc2378_i2c_reset(struct i2c_master_s * dev); +static int lpc2378_i2c_reset(struct i2c_master_s *dev); #endif /**************************************************************************** @@ -457,7 +457,7 @@ static int lpc2378_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int lpc2378_i2c_reset(struct i2c_master_s * dev) +static int lpc2378_i2c_reset(struct i2c_master_s *dev) { return OK; } @@ -614,9 +614,9 @@ struct i2c_master_s *lpc2378_i2cbus_initialize(int port) * ****************************************************************************/ -int lpc2378_i2cbus_uninitialize(struct i2c_master_s * dev) +int lpc2378_i2cbus_uninitialize(struct i2c_master_s *dev) { - struct lpc2378_i2cdev_s *priv = (struct lpc2378_i2cdev_s *) dev; + struct lpc2378_i2cdev_s *priv = (struct lpc2378_i2cdev_s *)dev; /* Disable I2C */ diff --git a/arch/arm/src/lpc2378/lpc23xx_spi.c b/arch/arm/src/lpc2378/lpc23xx_spi.c index 85e0985ba8..058c113697 100644 --- a/arch/arm/src/lpc2378/lpc23xx_spi.c +++ b/arch/arm/src/lpc2378/lpc23xx_spi.c @@ -158,10 +158,10 @@ static const struct spi_ops_s g_spiops = static struct lpc23xx_spidev_s g_spidev = { .spidev = - { - &g_spiops - }, - .lock = NXMUTEX_INITIALIZER, + { + .ops = &g_spiops, + }, + .lock = NXMUTEX_INITIALIZER, }; /**************************************************************************** diff --git a/arch/arm/src/lpc31xx/lpc31_i2c.c b/arch/arm/src/lpc31xx/lpc31_i2c.c index 8979cda244..880a002108 100644 --- a/arch/arm/src/lpc31xx/lpc31_i2c.c +++ b/arch/arm/src/lpc31xx/lpc31_i2c.c @@ -115,7 +115,7 @@ static void i2c_setfrequency(struct lpc31_i2cdev_s *priv, static int i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int i2c_reset(struct i2c_master_s * dev); +static int i2c_reset(struct i2c_master_s *dev); #endif /**************************************************************************** @@ -418,7 +418,7 @@ out: static void i2c_timeout(wdparm_t arg) { - struct lpc31_i2cdev_s *priv = (struct lpc31_i2cdev_s *) arg; + struct lpc31_i2cdev_s *priv = (struct lpc31_i2cdev_s *)arg; irqstate_t flags = enter_critical_section(); @@ -478,7 +478,7 @@ static void i2c_hwreset(struct lpc31_i2cdev_s *priv) static int i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count) { - struct lpc31_i2cdev_s *priv = (struct lpc31_i2cdev_s *) dev; + struct lpc31_i2cdev_s *priv = (struct lpc31_i2cdev_s *)dev; irqstate_t flags; int ret; @@ -539,7 +539,7 @@ static int i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int i2c_reset(struct i2c_master_s * dev) +static int i2c_reset(struct i2c_master_s *dev) { return OK; } diff --git a/arch/arm/src/lpc31xx/lpc31_spi.c b/arch/arm/src/lpc31xx/lpc31_spi.c index 3519b9fe8d..7d897029a9 100644 --- a/arch/arm/src/lpc31xx/lpc31_spi.c +++ b/arch/arm/src/lpc31xx/lpc31_spi.c @@ -154,10 +154,10 @@ static const struct spi_ops_s g_spiops = static struct lpc31_spidev_s g_spidev = { .spidev = - { - &g_spiops - }, - .lock = NXMUTEX_INITIALIZER, + { + .ops = &g_spiops, + }, + .lock = NXMUTEX_INITIALIZER, }; #ifdef CONFIG_LPC31_SPI_REGDEBUG @@ -489,7 +489,7 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) static void spi_select(struct spi_dev_s *dev, uint32_t devid, bool selected) { - struct lpc31_spidev_s *priv = (struct lpc31_spidev_s *) dev; + struct lpc31_spidev_s *priv = (struct lpc31_spidev_s *)dev; uint8_t slave = 0; /* FIXME: map the devid to the SPI slave - this should really diff --git a/arch/arm/src/lpc43xx/lpc43_i2c.c b/arch/arm/src/lpc43xx/lpc43_i2c.c index 016f25a11e..42ce665a0d 100644 --- a/arch/arm/src/lpc43xx/lpc43_i2c.c +++ b/arch/arm/src/lpc43xx/lpc43_i2c.c @@ -145,7 +145,7 @@ static void lpc43_i2c_setfrequency(struct lpc43_i2cdev_s *priv, static int lpc43_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int lpc43_i2c_reset(struct i2c_master_s * dev); +static int lpc43_i2c_reset(struct i2c_master_s *dev); #endif /**************************************************************************** @@ -436,7 +436,7 @@ static int lpc43_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int lpc43_i2c_reset(struct i2c_master_s * dev) +static int lpc43_i2c_reset(struct i2c_master_s *dev) { return OK; } @@ -558,9 +558,9 @@ struct i2c_master_s *lpc43_i2cbus_initialize(int port) * ****************************************************************************/ -int lpc43_i2cbus_uninitialize(struct i2c_master_s * dev) +int lpc43_i2cbus_uninitialize(struct i2c_master_s *dev) { - struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *) dev; + struct lpc43_i2cdev_s *priv = (struct lpc43_i2cdev_s *)dev; putreg32(I2C_CONCLRT_I2ENC, priv->base + LPC43_I2C_CONCLR_OFFSET); up_disable_irq(priv->irqid); diff --git a/arch/arm/src/lpc43xx/lpc43_spi.c b/arch/arm/src/lpc43xx/lpc43_spi.c index de44591550..97ed4f8c89 100644 --- a/arch/arm/src/lpc43xx/lpc43_spi.c +++ b/arch/arm/src/lpc43xx/lpc43_spi.c @@ -130,10 +130,10 @@ static const struct spi_ops_s g_spiops = static struct lpc43_spidev_s g_spidev = { .spidev = - { - &g_spiops - }, - .lock = NXMUTEX_INITIALIZER, + { + .ops = &g_spiops, + }, + .lock = NXMUTEX_INITIALIZER, }; /**************************************************************************** diff --git a/arch/arm/src/lpc43xx/lpc43_ssp.c b/arch/arm/src/lpc43xx/lpc43_ssp.c index 4f1025c5a3..2f9227b0d1 100644 --- a/arch/arm/src/lpc43xx/lpc43_ssp.c +++ b/arch/arm/src/lpc43xx/lpc43_ssp.c @@ -144,9 +144,9 @@ static const struct spi_ops_s g_spi0ops = static struct lpc43_sspdev_s g_ssp0dev = { .spidev = - { - &g_spi0ops - }, + { + .ops = &g_spi0ops, + }, .sspbase = LPC43_SSP0_BASE, .sspbasefreq = BOARD_SSP0_BASEFREQ, #ifdef CONFIG_LPC43_SSP_INTERRUPTS @@ -185,9 +185,9 @@ static const struct spi_ops_s g_spi1ops = static struct lpc43_sspdev_s g_ssp1dev = { .spidev = - { - &g_spi1ops - }, + { + .ops = &g_spi1ops, + }, .sspbase = LPC43_SSP1_BASE, .sspbasefreq = BOARD_SSP1_BASEFREQ, #ifdef CONFIG_LPC43_SSP_INTERRUPTS diff --git a/arch/arm/src/lpc54xx/lpc54_i2c_master.c b/arch/arm/src/lpc54xx/lpc54_i2c_master.c index 3515ddd168..a068959759 100644 --- a/arch/arm/src/lpc54xx/lpc54_i2c_master.c +++ b/arch/arm/src/lpc54xx/lpc54_i2c_master.c @@ -169,7 +169,7 @@ static int lpc54_i2c_poll(struct lpc54_i2cdev_s *priv); static int lpc54_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int lpc54_i2c_reset(struct i2c_master_s * dev); +static int lpc54_i2c_reset(struct i2c_master_s *dev); #endif /**************************************************************************** @@ -878,7 +878,7 @@ static int lpc54_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int lpc54_i2c_reset(struct i2c_master_s * dev) +static int lpc54_i2c_reset(struct i2c_master_s *dev) { #warning Missing logic return OK; @@ -1302,9 +1302,9 @@ struct i2c_master_s *lpc54_i2cbus_initialize(int port) * ****************************************************************************/ -int lpc54_i2cbus_uninitialize(struct i2c_master_s * dev) +int lpc54_i2cbus_uninitialize(struct i2c_master_s *dev) { - struct lpc54_i2cdev_s *priv = (struct lpc54_i2cdev_s *) dev; + struct lpc54_i2cdev_s *priv = (struct lpc54_i2cdev_s *)dev; uint32_t regval; /* Disable I2C interrupts */ diff --git a/arch/arm/src/lpc54xx/lpc54_rtc_lowerhalf.c b/arch/arm/src/lpc54xx/lpc54_rtc_lowerhalf.c index ebc11162a5..5d9169dd1d 100644 --- a/arch/arm/src/lpc54xx/lpc54_rtc_lowerhalf.c +++ b/arch/arm/src/lpc54xx/lpc54_rtc_lowerhalf.c @@ -145,7 +145,7 @@ static const struct rtc_ops_s g_rtc_ops = static struct lpc54_lowerhalf_s g_rtc_lowerhalf = { - .ops = &g_rtc_ops, + .ops = &g_rtc_ops, .devlock = NXMUTEX_INITIALIZER, }; diff --git a/arch/arm/src/lpc54xx/lpc54_usb0_ohci.c b/arch/arm/src/lpc54xx/lpc54_usb0_ohci.c index 6c47ceb055..b399369977 100644 --- a/arch/arm/src/lpc54xx/lpc54_usb0_ohci.c +++ b/arch/arm/src/lpc54xx/lpc54_usb0_ohci.c @@ -510,8 +510,8 @@ static struct lpc54_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = lpc54_wait, - .enumerate = lpc54_enumerate, + .wait = lpc54_wait, + .enumerate = lpc54_enumerate, }; /* Aligned static memory allocations */ @@ -2756,7 +2756,7 @@ static int lpc54_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, struct lpc54_usbhost_s *priv = (struct lpc54_usbhost_s *)drvr; struct lpc54_ed_s *ed = (struct lpc54_ed_s *)ep0; uint16_t len; - int ret; + int ret; DEBUGASSERT(priv != NULL && ed != NULL && req != NULL); @@ -2799,7 +2799,7 @@ static int lpc54_ctrlout(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, struct lpc54_usbhost_s *priv = (struct lpc54_usbhost_s *)drvr; struct lpc54_ed_s *ed = (struct lpc54_ed_s *)ep0; uint16_t len; - int ret; + int ret; DEBUGASSERT(priv != NULL && ed != NULL && req != NULL); @@ -3721,7 +3721,7 @@ static inline void lpc54_ep0init(struct lpc54_usbhost_s *priv) /* Initialize the common tail TD. */ memset(TDTAIL, 0, sizeof(struct lpc54_gtd_s)); - TDTAIL->ed = EDCTRL; + TDTAIL->ed = EDCTRL; /* Link the common tail TD to the ED's TD list */ diff --git a/arch/arm/src/max326xx/common/max326_rtc_lowerhalf.c b/arch/arm/src/max326xx/common/max326_rtc_lowerhalf.c index 60a4bb9100..f7aeb31c33 100644 --- a/arch/arm/src/max326xx/common/max326_rtc_lowerhalf.c +++ b/arch/arm/src/max326xx/common/max326_rtc_lowerhalf.c @@ -151,7 +151,7 @@ static const struct rtc_ops_s g_rtc_ops = static struct max326_lowerhalf_s g_rtc_lowerhalf = { - .ops = &g_rtc_ops, + .ops = &g_rtc_ops, .devlock = NXMUTEX_INITIALIZER, }; diff --git a/arch/arm/src/max326xx/max32660/max32660_spim.c b/arch/arm/src/max326xx/max32660/max32660_spim.c index af974fe415..0ea705835c 100644 --- a/arch/arm/src/max326xx/max32660/max32660_spim.c +++ b/arch/arm/src/max326xx/max32660/max32660_spim.c @@ -189,7 +189,7 @@ static void spi_recvblock(struct spi_dev_s *dev, void *rxbuffer, /* Initialization */ -static void spi_bus_initialize(struct max326_spidev_s *priv); +static void spi_bus_initialize(struct max326_spidev_s *priv); /**************************************************************************** * Private Data @@ -232,9 +232,9 @@ static const struct spi_ops_s g_sp0iops = static struct max326_spidev_s g_spi0dev = { .dev = - { - &g_sp0iops - }, + { + .ops = &g_sp0iops, + }, .base = MAX326_SPI0_BASE, .lock = NXMUTEX_INITIALIZER, #ifdef CONFIG_MAX326_SPI_INTERRUPTS diff --git a/arch/arm/src/nrf52/nrf52_rng.c b/arch/arm/src/nrf52/nrf52_rng.c index cc4f31541c..80ffae627b 100644 --- a/arch/arm/src/nrf52/nrf52_rng.c +++ b/arch/arm/src/nrf52/nrf52_rng.c @@ -145,7 +145,7 @@ static int nrf52_rng_initialize(void) static int nrf52_rng_irqhandler(int irq, void *context, void *arg) { - struct rng_dev_s *priv = (struct rng_dev_s *) &g_rngdev; + struct rng_dev_s *priv = (struct rng_dev_s *)&g_rngdev; uint8_t *addr; if (getreg32(NRF52_RNG_EVENTS_RDY) == RNG_INT_RDY) @@ -200,7 +200,7 @@ static ssize_t nrf52_rng_read(struct file *filep, char *buffer, return -EBUSY; } - priv->rd_buf = (uint8_t *) buffer; + priv->rd_buf = (uint8_t *)buffer; priv->buflen = buflen; priv->rd_count = 0; diff --git a/arch/arm/src/nrf52/nrf52_spi.c b/arch/arm/src/nrf52/nrf52_spi.c index b706f28ca8..b42fb8d07b 100644 --- a/arch/arm/src/nrf52/nrf52_spi.c +++ b/arch/arm/src/nrf52/nrf52_spi.c @@ -198,7 +198,7 @@ static struct nrf52_spidev_s g_spi0dev = { .spidev = { - &g_spi0ops + .ops = &g_spi0ops, }, .base = NRF52_SPIM0_BASE, @@ -251,7 +251,7 @@ static struct nrf52_spidev_s g_spi1dev = { .spidev = { - &g_spi1ops + .ops = &g_spi1ops, }, .base = NRF52_SPIM1_BASE, @@ -304,7 +304,7 @@ static struct nrf52_spidev_s g_spi2dev = { .spidev = { - &g_spi2ops + .ops = &g_spi2ops, }, .base = NRF52_SPIM2_BASE, @@ -357,7 +357,7 @@ static struct nrf52_spidev_s g_spi3dev = { .spidev = { - &g_spi3ops + .ops = &g_spi3ops, }, .base = NRF52_SPIM3_BASE, diff --git a/arch/arm/src/rp2040/rp2040_flash_mtd.c b/arch/arm/src/rp2040/rp2040_flash_mtd.c index 74554cd2c6..3d5a6d32d4 100644 --- a/arch/arm/src/rp2040/rp2040_flash_mtd.c +++ b/arch/arm/src/rp2040/rp2040_flash_mtd.c @@ -68,8 +68,8 @@ #define FLASH_BLOCK_ERASE_CMD 0x20 #define BOOT_2_SIZE 256 -#define FLASH_START_OFFSET (rp2040_smart_flash_start - (uint8_t *) XIP_BASE) -#define FLASH_END_OFFSET (rp2040_smart_flash_end - (uint8_t *) XIP_BASE) +#define FLASH_START_OFFSET (rp2040_smart_flash_start - (uint8_t *)XIP_BASE) +#define FLASH_END_OFFSET (rp2040_smart_flash_end - (uint8_t *)XIP_BASE) #define FLASH_START_READ (rp2040_smart_flash_start + 0x03000000) /* Note: There is some ambiguity in terminology when it comes to flash. @@ -155,16 +155,16 @@ extern const uint8_t rp2040_smart_flash_end[0]; static struct rp2040_flash_dev_s my_dev = { .mtd_dev = - { - rp2040_flash_erase, - rp2040_flash_block_read, - rp2040_flash_block_write, - rp2040_flash_byte_read, + { + rp2040_flash_erase, + rp2040_flash_block_read, + rp2040_flash_block_write, + rp2040_flash_byte_read, #ifdef CONFIG_MTD_BYTE_WRITE - NULL, + NULL, #endif - rp2040_flash_ioctl, - "rp_flash" + rp2040_flash_ioctl, + "rp_flash" }, .lock = NXMUTEX_INITIALIZER, }; @@ -247,7 +247,7 @@ static int rp2040_flash_erase(struct mtd_dev_s *dev, off_t startblock, size_t nblocks) { - rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *) dev; + rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *)dev; irqstate_t flags; int ret = OK; @@ -293,7 +293,7 @@ static ssize_t rp2040_flash_block_read(struct mtd_dev_s *dev, size_t nblocks, uint8_t *buffer) { - rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *) dev; + rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *)dev; int start; int length; int ret = OK; @@ -336,7 +336,7 @@ static ssize_t rp2040_flash_block_write(struct mtd_dev_s *dev, size_t nblocks, const uint8_t *buffer) { - rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *) dev; + rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *)dev; irqstate_t flags; int ret; @@ -443,7 +443,7 @@ static int rp2040_flash_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg) { - rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *) dev; + rp2040_flash_dev_t *rp_dev = (rp2040_flash_dev_t *)dev; int ret = OK; UNUSED(rp_dev); @@ -452,7 +452,7 @@ static int rp2040_flash_ioctl(struct mtd_dev_s *dev, { case MTDIOC_GEOMETRY: { - struct mtd_geometry_s *geo = (struct mtd_geometry_s *) arg; + struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg; if (geo != NULL) { @@ -525,7 +525,7 @@ struct mtd_dev_s *rp2040_flash_mtd_initialize(void) * the rom until after this call completes. */ - memcpy(my_dev.boot_2, (void *) XIP_BASE, BOOT_2_SIZE); + memcpy(my_dev.boot_2, (void *)XIP_BASE, BOOT_2_SIZE); rom_functions.flash_enable_xip = (flash_enable_xip_f)my_dev.boot_2 + 1; /* Do we need to initialize the flash? */ diff --git a/arch/arm/src/rp2040/rp2040_i2s.c b/arch/arm/src/rp2040/rp2040_i2s.c index 725d77dea9..b92b199202 100644 --- a/arch/arm/src/rp2040/rp2040_i2s.c +++ b/arch/arm/src/rp2040/rp2040_i2s.c @@ -964,7 +964,7 @@ static int rp2040_i2s_ioctl(struct i2s_dev_s *dev, int cmd, unsigned long arg) { struct rp2040_i2s_s *priv = (struct rp2040_i2s_s *)dev; - struct audio_buf_desc_s *bufdesc; + struct audio_buf_desc_s *bufdesc; int ret = -ENOTTY; switch (cmd) @@ -1095,7 +1095,7 @@ static int rp2040_i2s_ioctl(struct i2s_dev_s *dev, int cmd, { i2sinfo("AUDIOIOC_ALLOCBUFFER\n"); - bufdesc = (struct audio_buf_desc_s *) arg; + bufdesc = (struct audio_buf_desc_s *)arg; ret = apb_alloc(bufdesc); } break; @@ -1109,7 +1109,7 @@ static int rp2040_i2s_ioctl(struct i2s_dev_s *dev, int cmd, { i2sinfo("AUDIOIOC_FREEBUFFER\n"); - bufdesc = (struct audio_buf_desc_s *) arg; + bufdesc = (struct audio_buf_desc_s *)arg; DEBUGASSERT(bufdesc->u.buffer != NULL); apb_free(bufdesc->u.buffer); ret = sizeof(struct audio_buf_desc_s); diff --git a/arch/arm/src/rp2040/rp2040_spi.c b/arch/arm/src/rp2040/rp2040_spi.c index 02d682cd6b..c0b34ff560 100644 --- a/arch/arm/src/rp2040/rp2040_spi.c +++ b/arch/arm/src/rp2040/rp2040_spi.c @@ -177,9 +177,9 @@ static const struct spi_ops_s g_spi0ops = static struct rp2040_spidev_s g_spi0dev = { .spidev = - { - &g_spi0ops - }, + { + .ops = &g_spi0ops, + }, .spibase = RP2040_SPI0_BASE, .spibasefreq = 0, .port = 0, @@ -226,9 +226,9 @@ static const struct spi_ops_s g_spi1ops = static struct rp2040_spidev_s g_spi1dev = { .spidev = - { - &g_spi1ops - }, + { + .ops = &g_spi1ops, + }, .spibase = RP2040_SPI1_BASE, .spibasefreq = 0, .port = 1, @@ -874,7 +874,6 @@ struct spi_dev_s *rp2040_spibus_initialize(int port) /* Set a initialized flag */ priv->initialized = 1; - return &priv->spidev; } diff --git a/arch/arm/src/s32k1xx/s32k1xx_lpi2c.c b/arch/arm/src/s32k1xx/s32k1xx_lpi2c.c index a18a86057a..c41394eee6 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_lpi2c.c +++ b/arch/arm/src/s32k1xx/s32k1xx_lpi2c.c @@ -1776,8 +1776,8 @@ static int s32k1xx_lpi2c_dma_transfer(struct s32k1xx_lpi2c_priv_s *priv) LPI2C_MIER_NDIE | LPI2C_MIER_ALIE | LPI2C_MIER_PLTIE | LPI2C_MIER_FEIE); - s32k1xx_dmach_start(priv->rxdma, s32k1xx_rxdma_callback, (void *)priv); - s32k1xx_dmach_start(priv->txdma, s32k1xx_txdma_callback, (void *)priv); + s32k1xx_dmach_start(priv->rxdma, s32k1xx_rxdma_callback, priv); + s32k1xx_dmach_start(priv->txdma, s32k1xx_txdma_callback, priv); s32k1xx_lpi2c_modifyreg(priv, S32K1XX_LPI2C_MDER_OFFSET, 0, LPI2C_MDER_TDDE | LPI2C_MDER_RDDE); diff --git a/arch/arm/src/s32k1xx/s32k1xx_lpspi.c b/arch/arm/src/s32k1xx/s32k1xx_lpspi.c index 58ffd13476..8554546cff 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_lpspi.c +++ b/arch/arm/src/s32k1xx/s32k1xx_lpspi.c @@ -255,7 +255,7 @@ static struct s32k1xx_lpspidev_s g_lpspi0dev = { .spidev = { - &g_spi0ops + .ops = &g_spi0ops, }, .spibase = S32K1XX_LPSPI0_BASE, #ifdef CONFIG_S32K1XX_LPSPI_INTERRUPTS @@ -306,7 +306,7 @@ static struct s32k1xx_lpspidev_s g_lpspi1dev = { .spidev = { - &g_spi1ops + .ops = &g_spi1ops, }, .spibase = S32K1XX_LPSPI1_BASE, #ifdef CONFIG_S32K1XX_LPSPI_INTERRUPTS @@ -357,7 +357,7 @@ static struct s32k1xx_lpspidev_s g_lpspi2dev = { .spidev = { - &g_spi2ops + .ops = &g_spi2ops, }, .spibase = S32K1XX_LPSPI2_BASE, #ifdef CONFIG_S32K1XX_LPSPI_INTERRUPTS @@ -1369,8 +1369,8 @@ static void s32k1xx_lpspi_exchange_nodma(struct spi_dev_s *dev, * take care of big endian mode of hardware !! */ - const uint8_t *src = (const uint8_t *)txbuffer; - uint8_t *dest = (uint8_t *) rxbuffer; + const uint8_t *src = txbuffer; + uint8_t *dest = rxbuffer; uint32_t word = 0x0; #ifdef CONFIG_S32K1XX_LPSPI_DWORD uint32_t word1 = 0x0; @@ -1447,8 +1447,8 @@ static void s32k1xx_lpspi_exchange_nodma(struct spi_dev_s *dev, { /* 32-bit or 64 bit, word size memory transfers */ - const uint32_t *src = (const uint32_t *)txbuffer; - uint32_t *dest = (uint32_t *) rxbuffer; + const uint32_t *src = txbuffer; + uint32_t *dest = rxbuffer; uint32_t word = 0x0; #ifdef CONFIG_S32K1XX_LPSPI_DWORD uint32_t word1 = 0x0; @@ -1528,8 +1528,8 @@ static void s32k1xx_lpspi_exchange_nodma(struct spi_dev_s *dev, { /* 16-bit mode */ - const uint16_t *src = (const uint16_t *)txbuffer; - uint16_t *dest = (uint16_t *) rxbuffer; + const uint16_t *src = txbuffer; + uint16_t *dest = rxbuffer; uint16_t word; while (nwords-- > 0) @@ -1563,8 +1563,8 @@ static void s32k1xx_lpspi_exchange_nodma(struct spi_dev_s *dev, { /* 8-bit mode */ - const uint8_t *src = (const uint8_t *)txbuffer; - uint8_t *dest = (uint8_t *) rxbuffer; + const uint8_t *src = txbuffer; + uint8_t *dest = rxbuffer; uint8_t word; while (nwords-- > 0) diff --git a/arch/arm/src/s32k3xx/s32k3xx_lpspi.c b/arch/arm/src/s32k3xx/s32k3xx_lpspi.c index 1d0b234662..a7d1bca823 100644 --- a/arch/arm/src/s32k3xx/s32k3xx_lpspi.c +++ b/arch/arm/src/s32k3xx/s32k3xx_lpspi.c @@ -246,7 +246,7 @@ static struct s32k3xx_lpspidev_s g_lpspi0dev = { .spidev = { - &g_spi0ops + .ops = &g_spi0ops, }, .spibase = S32K3XX_LPSPI0_BASE, #ifdef CONFIG_S32K3XX_LPSPI_INTERRUPTS @@ -296,7 +296,7 @@ static struct s32k3xx_lpspidev_s g_lpspi1dev = { .spidev = { - &g_spi1ops + .ops = &g_spi1ops, }, .spibase = S32K3XX_LPSPI1_BASE, #ifdef CONFIG_S32K3XX_LPSPI_INTERRUPTS @@ -346,7 +346,7 @@ static struct s32k3xx_lpspidev_s g_lpspi2dev = { .spidev = { - &g_spi2ops + .ops = &g_spi2ops, }, .spibase = S32K3XX_LPSPI2_BASE, #ifdef CONFIG_S32K3XX_LPSPI_INTERRUPTS @@ -396,7 +396,7 @@ static struct s32k3xx_lpspidev_s g_lpspi3dev = { .spidev = { - &g_spi3ops + .ops = &g_spi3ops, }, .spibase = S32K3XX_LPSPI3_BASE, #ifdef CONFIG_S32K3XX_LPSPI_INTERRUPTS @@ -446,7 +446,7 @@ static struct s32k3xx_lpspidev_s g_lpspi4dev = { .spidev = { - &g_spi4ops + .ops = &g_spi4ops, }, .spibase = S32K3XX_LPSPI4_BASE, #ifdef CONFIG_S32K3XX_LPSPI_INTERRUPTS @@ -496,7 +496,7 @@ static struct s32k3xx_lpspidev_s g_lpspi5dev = { .spidev = { - &g_spi5ops + .ops = &g_spi5ops, }, .spibase = S32K3XX_LPSPI5_BASE, #ifdef CONFIG_S32K3XX_LPSPI_INTERRUPTS @@ -1535,8 +1535,8 @@ static void s32k3xx_lpspi_exchange_nodma(struct spi_dev_s *dev, * take care of big endian mode of hardware !! */ - const uint8_t *src = (const uint8_t *)txbuffer; - uint8_t *dest = (uint8_t *) rxbuffer; + const uint8_t *src = txbuffer; + uint8_t *dest = rxbuffer; uint32_t word = 0x0; #ifdef CONFIG_S32K3XX_LPSPI_DWORD uint32_t word1 = 0x0; @@ -1613,8 +1613,8 @@ static void s32k3xx_lpspi_exchange_nodma(struct spi_dev_s *dev, { /* 32-bit or 64 bit, word size memory transfers */ - const uint32_t *src = (const uint32_t *)txbuffer; - uint32_t *dest = (uint32_t *) rxbuffer; + const uint32_t *src = txbuffer; + uint32_t *dest = rxbuffer; uint32_t word = 0x0; #ifdef CONFIG_S32K3XX_LPSPI_DWORD uint32_t word1 = 0x0; @@ -1694,8 +1694,8 @@ static void s32k3xx_lpspi_exchange_nodma(struct spi_dev_s *dev, { /* 16-bit mode */ - const uint16_t *src = (const uint16_t *)txbuffer; - uint16_t *dest = (uint16_t *) rxbuffer; + const uint16_t *src = txbuffer; + uint16_t *dest = rxbuffer; uint16_t word; while (nwords-- > 0) @@ -1729,8 +1729,8 @@ static void s32k3xx_lpspi_exchange_nodma(struct spi_dev_s *dev, { /* 8-bit mode */ - const uint8_t *src = (const uint8_t *)txbuffer; - uint8_t *dest = (uint8_t *) rxbuffer; + const uint8_t *src = txbuffer; + uint8_t *dest = rxbuffer; uint8_t word; while (nwords-- > 0) @@ -1786,12 +1786,12 @@ static void s32k3xx_lpspi_exchange(struct spi_dev_s *dev, const void *txbuffer, void *rxbuffer, size_t nwords) { - int ret; - size_t adjust; - ssize_t nbytes; - static uint8_t rxdummy[4] aligned_data(4); - static const uint16_t txdummy = 0xffff; - uint32_t regval; + int ret; + size_t adjust; + ssize_t nbytes; + static uint8_t rxdummy[4] aligned_data(4); + static const uint16_t txdummy = 0xffff; + uint32_t regval; struct s32k3xx_lpspidev_s *priv = (struct s32k3xx_lpspidev_s *)dev; DEBUGASSERT(priv != NULL); diff --git a/arch/arm/src/s32k3xx/s32k3xx_qspi.c b/arch/arm/src/s32k3xx/s32k3xx_qspi.c index d9be63a0a7..833701cb7c 100644 --- a/arch/arm/src/s32k3xx/s32k3xx_qspi.c +++ b/arch/arm/src/s32k3xx/s32k3xx_qspi.c @@ -221,7 +221,7 @@ static const struct qspi_ops_s g_qspi0ops = static struct s32k3xx_qspidev_s g_qspi0dev = { - .qspi = + .qspi = { .ops = &g_qspi0ops, }, diff --git a/arch/arm/src/sam34/sam_twi.c b/arch/arm/src/sam34/sam_twi.c index 93ae0abc9d..8f110ad82e 100644 --- a/arch/arm/src/sam34/sam_twi.c +++ b/arch/arm/src/sam34/sam_twi.c @@ -172,16 +172,16 @@ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg); /* I2C device operations */ static int twi_transfer(struct i2c_master_s *dev, - struct i2c_msg_s *msgs, int count); + struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int twi_reset(struct i2c_master_s * dev); +static int twi_reset(struct i2c_master_s *dev); #endif /* Initialization */ static void twi_setfrequency(struct twi_dev_s *priv, uint32_t frequency); static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid, - uint32_t frequency); + uint32_t frequency); /**************************************************************************** * Private Data @@ -747,7 +747,7 @@ static int twi_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int twi_reset(struct i2c_master_s * dev) +static int twi_reset(struct i2c_master_s *dev) { return OK; } @@ -982,9 +982,9 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) * ****************************************************************************/ -int sam_i2cbus_uninitialize(struct i2c_master_s * dev) +int sam_i2cbus_uninitialize(struct i2c_master_s *dev) { - struct twi_dev_s *priv = (struct twi_dev_s *) dev; + struct twi_dev_s *priv = (struct twi_dev_s *)dev; i2cinfo("TWI%d Un-initializing\n", priv->twi); diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index 34da2bee1b..79893b7e79 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -3114,7 +3114,7 @@ static int sam_ctrlin(struct usbhost_driver_s *drvr, usbhost_ep_t ep0, struct sam_rhport_s *rhport = (struct sam_rhport_s *)drvr; struct sam_eplist_s *eplist = (struct sam_eplist_s *)ep0; uint16_t len; - int ret; + int ret; DEBUGASSERT(rhport != NULL && eplist != NULL && req != NULL); diff --git a/arch/arm/src/sama5/sam_sdmmc.c b/arch/arm/src/sama5/sam_sdmmc.c index d1db6a9af8..aa6b2bf74f 100644 --- a/arch/arm/src/sama5/sam_sdmmc.c +++ b/arch/arm/src/sama5/sam_sdmmc.c @@ -378,7 +378,7 @@ struct sam_dev_s g_sdmmcdev[SAM_MAX_SDMMC_DEV_SLOTS] = .sw_cd_gpio = PIN_SDMMC0_CD_GPIO, #endif #if defined(CONFIG_SAMA5_SDMMC0_INVERT_CD) - .cd_invert = true, + .cd_invert = true, #endif .dev = { @@ -437,7 +437,7 @@ struct sam_dev_s g_sdmmcdev[SAM_MAX_SDMMC_DEV_SLOTS] = .sw_cd_gpio = PIN_SDMMC1_CD_GPIO, #endif #if defined(CONFIG_SAMA5_SDMMC1_INVERT_CD) - .cd_invert = true, + .cd_invert = true, #endif .dev = { @@ -1111,7 +1111,7 @@ static void sam_receive(struct sam_dev_s *priv) { /* Transfer any trailing fractional word */ - uint8_t *ptr = (uint8_t *) priv->buffer; + uint8_t *ptr = (uint8_t *)priv->buffer; int i; for (i = 0; i < priv->remaining; i++) @@ -1873,7 +1873,7 @@ static void sam_frequency(struct sdio_dev_s *dev, uint32_t frequency) static void sam_clock(struct sdio_dev_s *dev, enum sdio_clock_e rate) { - struct sam_dev_s *priv = (struct sam_dev_s *) dev; + struct sam_dev_s *priv = (struct sam_dev_s *)dev; uint32_t regval; int wait_microseconds = 0; @@ -2354,7 +2354,7 @@ static int sam_recvsetup(struct sdio_dev_s *dev, uint8_t *buffer, * handler and DMA memory invalidation. */ - priv->buffer = (uint32_t *) buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = nbytes; /* Then set up the SDIO data path */ @@ -2408,7 +2408,8 @@ static int sam_sendsetup(struct sdio_dev_s *dev, /* Save the source buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t *) buffer; priv->remaining = nbytes; + priv->buffer = (uint32_t *)buffer; + priv->remaining = nbytes; /* Then set up the SDIO data path */ @@ -3052,7 +3053,7 @@ static int sam_dmarecvsetup(struct sdio_dev_s *dev, * handler */ - priv->buffer = (uint32_t *) buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; priv->bufferend = (uint32_t *)(buffer + buflen); @@ -3122,7 +3123,7 @@ static int sam_dmasendsetup(struct sdio_dev_s *dev, /* Save the source buffer information for use by the interrupt handler */ - priv->buffer = (uint32_t *) buffer; + priv->buffer = (uint32_t *)buffer; priv->remaining = buflen; priv->bufferend = (uint32_t *)(buffer + buflen); @@ -3610,8 +3611,8 @@ struct sdio_dev_s *sam_sdmmc_sdio_initialize(int slotno) sam_configpio(PIO_SDMMC0_CK); sam_configpio(PIO_SDMMC0_CMD); -# if ( defined(CONFIG_SAMA5_SDMMC0_WIDTH_D1_D4) || \ - defined(CONFIG_SAMA5_SDMMC0_WIDTH_D1_D8) ) +# if (defined(CONFIG_SAMA5_SDMMC0_WIDTH_D1_D4) || \ + defined(CONFIG_SAMA5_SDMMC0_WIDTH_D1_D8)) sam_configpio(PIO_SDMMC0_DAT1); sam_configpio(PIO_SDMMC0_DAT2); sam_configpio(PIO_SDMMC0_DAT3); diff --git a/arch/arm/src/sama5/sam_twi.c b/arch/arm/src/sama5/sam_twi.c index 507692a29b..41a316a8a8 100644 --- a/arch/arm/src/sama5/sam_twi.c +++ b/arch/arm/src/sama5/sam_twi.c @@ -215,9 +215,9 @@ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg); /* I2C device operations */ static int twi_transfer(struct i2c_master_s *dev, - struct i2c_msg_s *msgs, int count); + struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int twi_reset(struct i2c_master_s * dev); +static int twi_reset(struct i2c_master_s *dev); #endif /* Initialization */ @@ -1289,7 +1289,7 @@ errout_with_lock: int sam_i2cbus_uninitialize(struct i2c_master_s *dev) { - struct twi_dev_s *priv = (struct twi_dev_s *) dev; + struct twi_dev_s *priv = (struct twi_dev_s *)dev; i2cinfo("TWI%d Un-initializing\n", priv->attr->twi); diff --git a/arch/arm/src/sama5/sam_xdmac.c b/arch/arm/src/sama5/sam_xdmac.c index d8510f84f4..0074f11279 100644 --- a/arch/arm/src/sama5/sam_xdmac.c +++ b/arch/arm/src/sama5/sam_xdmac.c @@ -548,7 +548,7 @@ static struct sam_xdmac_s g_xdmac0 = /* This array describes the available link list descriptors */ - .descr = g_desc0, + .descr = g_desc0, /* This array describes each DMA channel */ @@ -725,7 +725,7 @@ static struct sam_xdmac_s g_xdmac1 = /* This array describes the available link list descriptors */ - .descr = g_desc1, + .descr = g_desc1, /* This array describes each DMA channel */ diff --git a/arch/arm/src/samd2l2/sam_spi.c b/arch/arm/src/samd2l2/sam_spi.c index 4eac237cfa..23fda9dba2 100644 --- a/arch/arm/src/samd2l2/sam_spi.c +++ b/arch/arm/src/samd2l2/sam_spi.c @@ -1174,8 +1174,8 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, /* Start RX and TX DMA channels */ - sam_dmastart(priv->dma_tx, spi_dma_callback, (void *)priv); - sam_dmastart(priv->dma_rx, spi_dma_callback, (void *)priv); + sam_dmastart(priv->dma_tx, spi_dma_callback, priv); + sam_dmastart(priv->dma_rx, spi_dma_callback, priv); /* Enable SPI to trigger the TX DMA channel */ diff --git a/arch/arm/src/samd5e5/sam_spi.c b/arch/arm/src/samd5e5/sam_spi.c index 72772a4092..0bf2c43e4c 100644 --- a/arch/arm/src/samd5e5/sam_spi.c +++ b/arch/arm/src/samd5e5/sam_spi.c @@ -1270,8 +1270,8 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, /* Start RX and TX DMA channels */ - sam_dmastart(priv->dma_tx, spi_dma_callback, (void *)priv); - sam_dmastart(priv->dma_rx, spi_dma_callback, (void *)priv); + sam_dmastart(priv->dma_tx, spi_dma_callback, priv); + sam_dmastart(priv->dma_rx, spi_dma_callback, priv); /* Enable SPI to trigger the TX DMA channel */ diff --git a/arch/arm/src/samd5e5/sam_usb.c b/arch/arm/src/samd5e5/sam_usb.c index 6408a411b3..949c41d4c3 100644 --- a/arch/arm/src/samd5e5/sam_usb.c +++ b/arch/arm/src/samd5e5/sam_usb.c @@ -1012,8 +1012,8 @@ static struct sam_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = sam_wait, - .enumerate = sam_enumerate, + .wait = sam_wait, + .enumerate = sam_enumerate, }; #endif @@ -3134,16 +3134,16 @@ static void sam_setdevaddr(struct sam_usbdev_s *priv, uint8_t address) static void sam_ep0_setup(struct sam_usbdev_s *priv) { - struct sam_ep_s *ep0 = &priv->eplist[EP0]; - struct sam_ep_s *privep; - union wb_u value; - union wb_u index; - union wb_u len; - union wb_u response; - enum sam_ep0setup_e ep0result; - uint8_t epno; - int nbytes = 0; /* Assume zero-length packet */ - int ret; + struct sam_ep_s *ep0 = &priv->eplist[EP0]; + struct sam_ep_s *privep; + union wb_u value; + union wb_u index; + union wb_u len; + union wb_u response; + enum sam_ep0setup_e ep0result; + uint8_t epno; + int nbytes = 0; /* Assume zero-length packet */ + int ret; /* Terminate any pending requests */ diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c index 7cbc94e337..a724dd7aca 100644 --- a/arch/arm/src/samv7/sam_mcan.c +++ b/arch/arm/src/samv7/sam_mcan.c @@ -384,7 +384,7 @@ (MCAN0_TXEVENTFIFO_BYTES >> 2) # define MCAN0_TXFIFIOQ_BYTES \ - MCAN_ALIGN_UP(CONFIG_SAMV7_MCAN0_TXFIFOQ_SIZE * \ + MCAN_ALIGN_UP(CONFIG_SAMV7_MCAN0_TXFIFOQ_SIZE * \ (MCAN0_TXBUFFER_ELEMENT_SIZE + 8)) # define MCAN0_TXFIFIOQ_WORDS (MCAN0_TXFIFIOQ_BYTES >> 2) @@ -669,7 +669,7 @@ (MCAN1_TXEVENTFIFO_BYTES >> 2) # define MCAN1_TXFIFIOQ_BYTES \ - MCAN_ALIGN_UP(CONFIG_SAMV7_MCAN1_TXFIFOQ_SIZE * \ + MCAN_ALIGN_UP(CONFIG_SAMV7_MCAN1_TXFIFOQ_SIZE * \ (MCAN1_TXBUFFER_ELEMENT_SIZE + 8)) # define MCAN1_TXFIFIOQ_WORDS (MCAN1_TXFIFIOQ_BYTES >> 2) @@ -1006,7 +1006,7 @@ static uint32_t g_mcan0_msgram[MCAN0_MSGRAM_WORDS] /* Constant configuration */ -static struct sam_config_s g_mcan0const = +static const struct sam_config_s g_mcan0const = { .rxpinset = GPIO_MCAN0_RX, .txpinset = GPIO_MCAN0_TX, @@ -1104,7 +1104,7 @@ static uint32_t g_mcan1_msgram[MCAN1_MSGRAM_WORDS] /* MCAN1 constant configuration */ -static struct sam_config_s g_mcan1const = +static const struct sam_config_s g_mcan1const = { .rxpinset = GPIO_MCAN1_RX, .txpinset = GPIO_MCAN1_TX, diff --git a/arch/arm/src/samv7/sam_qspi.c b/arch/arm/src/samv7/sam_qspi.c index e8d1f45f68..4953ce4a23 100644 --- a/arch/arm/src/samv7/sam_qspi.c +++ b/arch/arm/src/samv7/sam_qspi.c @@ -302,7 +302,7 @@ static const struct qspi_ops_s g_qspi0ops = static struct sam_qspidev_s g_qspi0dev = { - .qspi = + .qspi = { .ops = &g_qspi0ops, }, @@ -856,7 +856,7 @@ static int qspi_memory_dma(struct sam_qspidev_s *priv, /* Start the DMA */ priv->result = -EBUSY; - ret = sam_dmastart(priv->dmach, qspi_dma_callback, (void *)priv); + ret = sam_dmastart(priv->dmach, qspi_dma_callback, priv); if (ret < 0) { spierr("ERROR: sam_dmastart failed: %d\n", ret); diff --git a/arch/arm/src/samv7/sam_spi_slave.c b/arch/arm/src/samv7/sam_spi_slave.c index 4ca7208ca0..4cab3a5bbc 100644 --- a/arch/arm/src/samv7/sam_spi_slave.c +++ b/arch/arm/src/samv7/sam_spi_slave.c @@ -170,11 +170,11 @@ static const uint8_t g_csroffset[4] = static const struct spi_slave_ctrlrops_s g_ctrlr_ops = { - .bind = spi_bind, - .unbind = spi_unbind, - .enqueue = spi_enqueue, - .qfull = spi_qfull, - .qflush = spi_qflush, + .bind = spi_bind, + .unbind = spi_unbind, + .enqueue = spi_enqueue, + .qfull = spi_qfull, + .qflush = spi_qflush, }; #ifdef CONFIG_SAMV7_SPI0_SLAVE diff --git a/arch/arm/src/samv7/sam_twihs.c b/arch/arm/src/samv7/sam_twihs.c index 58efd28dab..133ba88313 100644 --- a/arch/arm/src/samv7/sam_twihs.c +++ b/arch/arm/src/samv7/sam_twihs.c @@ -214,10 +214,10 @@ static void twi_startmessage(struct twi_dev_s *priv, struct i2c_msg_s *msg); /* I2C device operations */ static int twi_transfer(struct i2c_master_s *dev, - struct i2c_msg_s *msgs, int count); + struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int twi_reset_internal(struct i2c_master_s *dev); -static int twi_reset(struct i2c_master_s * dev); +static int twi_reset_internal(struct i2c_master_s *dev); +static int twi_reset(struct i2c_master_s *dev); #endif /* Initialization */ @@ -1461,7 +1461,7 @@ errout_with_lock: int sam_i2cbus_uninitialize(struct i2c_master_s *dev) { - struct twi_dev_s *priv = (struct twi_dev_s *) dev; + struct twi_dev_s *priv = (struct twi_dev_s *)dev; DEBUGASSERT(priv); diff --git a/arch/arm/src/samv7/sam_xdmac.c b/arch/arm/src/samv7/sam_xdmac.c index d94177be5d..a7c1d2a9d9 100644 --- a/arch/arm/src/samv7/sam_xdmac.c +++ b/arch/arm/src/samv7/sam_xdmac.c @@ -189,7 +189,7 @@ static const struct sam_pidmap_s g_xdmac_txchan[] = /* This array describes the available link list descriptors */ -struct chnext_view1_s g_lldesc[CONFIG_SAMV7_NLLDESC]; +static struct chnext_view1_s g_lldesc[CONFIG_SAMV7_NLLDESC]; /* This array describes the state of each XDMAC channel 0 */ diff --git a/arch/arm/src/stm32/stm32_1wire.c b/arch/arm/src/stm32/stm32_1wire.c index 3809383294..1aa363d5c1 100644 --- a/arch/arm/src/stm32/stm32_1wire.c +++ b/arch/arm/src/stm32/stm32_1wire.c @@ -129,8 +129,8 @@ struct stm32_1wire_priv_s struct stm32_1wire_inst_s { - const struct onewire_ops_s *ops; /* Standard 1-Wire operations */ - struct stm32_1wire_priv_s *priv; /* Common driver private data structure */ + const struct onewire_ops_s *ops; /* Standard 1-Wire operations */ + struct stm32_1wire_priv_s *priv; /* Common driver private data structure */ }; /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_adc.c b/arch/arm/src/stm32/stm32_adc.c index 3bfdfbe116..a663db6936 100644 --- a/arch/arm/src/stm32/stm32_adc.c +++ b/arch/arm/src/stm32/stm32_adc.c @@ -1348,7 +1348,7 @@ static int adc_timinit(struct stm32_dev_s *priv) * 0 <= prescaler <= 65536 * 1 <= reload <= 65535 * - * So ( prescaler = pclck / 65535 / freq ) would be optimal. + * So (prescaler = pclck / 65535 / freq) would be optimal. */ prescaler = (priv->pclck / priv->freq + 65534) / 65535; diff --git a/arch/arm/src/stm32/stm32_dma2d.c b/arch/arm/src/stm32/stm32_dma2d.c index 9055c1170e..7b79560b87 100644 --- a/arch/arm/src/stm32/stm32_dma2d.c +++ b/arch/arm/src/stm32/stm32_dma2d.c @@ -110,7 +110,6 @@ struct stm32_dma2d_s #ifdef CONFIG_STM32_FB_CMAP uint32_t *clut; /* Color lookup table */ #endif - mutex_t *lock; /* Ensure mutually exclusive access */ }; @@ -463,8 +462,8 @@ static int stm32_dma2d_waitforirq(void) #ifdef CONFIG_STM32_DMA2D_L8 static int stm32_dma2d_loadclut(uintptr_t pfcreg) { - int ret; - uint32_t regval; + int ret; + uint32_t regval; /* Start clut loading */ @@ -497,7 +496,7 @@ static int stm32_dma2d_loadclut(uintptr_t pfcreg) static int stm32_dma2d_start(void) { - int ret; + int ret; /* Start dma transfer */ @@ -683,7 +682,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha, #ifdef CONFIG_STM32_FB_CMAP if (fmt == DMA2D_PF_L8) { - struct stm32_dma2d_s * layer = &g_dma2ddev; + struct stm32_dma2d_s *layer = &g_dma2ddev; /* Load CLUT automatically */ @@ -747,7 +746,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha, static int stm32_dma2d_setclut(const struct fb_cmap_s *cmap) { int n; - struct stm32_dma2d_s * priv = &g_dma2ddev; + struct stm32_dma2d_s *priv = &g_dma2ddev; lcdinfo("cmap=%p\n", cmap); @@ -816,7 +815,7 @@ static int stm32_dma2d_fillcolor(struct stm32_dma2d_overlay_s *oinfo, uint32_t argb) { int ret; - struct stm32_dma2d_s * priv = &g_dma2ddev; + struct stm32_dma2d_s *priv = &g_dma2ddev; DEBUGASSERT(oinfo != NULL && oinfo->oinfo != NULL && area != NULL); lcdinfo("oinfo=%p, argb=%08" PRIx32 "\n", oinfo, argb); @@ -897,9 +896,9 @@ static int stm32_dma2d_blit(struct stm32_dma2d_overlay_s *doverlay, struct stm32_dma2d_overlay_s *soverlay, const struct fb_area_s *sarea) { - int ret; - uint32_t mode; - struct stm32_dma2d_s * priv = &g_dma2ddev; + int ret; + uint32_t mode; + struct stm32_dma2d_s *priv = &g_dma2ddev; lcdinfo("doverlay=%p, destxpos=%" PRId32 ", destypos=%" PRId32 ", soverlay=%p, sarea=%p\n", @@ -997,8 +996,8 @@ static int stm32_dma2d_blend(struct stm32_dma2d_overlay_s *doverlay, struct stm32_dma2d_overlay_s *boverlay, const struct fb_area_s *barea) { - int ret; - struct stm32_dma2d_s * priv = &g_dma2ddev; + int ret; + struct stm32_dma2d_s *priv = &g_dma2ddev; lcdinfo("doverlay=%p, destxpos=%" PRId32 ", destypos=%" PRId32 ", " "foverlay=%p, forexpos=%" PRId32 ", foreypos=%" PRId32 ", " diff --git a/arch/arm/src/stm32/stm32_foc.c b/arch/arm/src/stm32/stm32_foc.c index c26a9a3a02..836921a3d1 100644 --- a/arch/arm/src/stm32/stm32_foc.c +++ b/arch/arm/src/stm32/stm32_foc.c @@ -1136,7 +1136,7 @@ static int stm32_foc_adc_start(struct foc_dev_s *dev, bool state) static int stm32_foc_adc_cfg(struct foc_dev_s *dev) { - struct stm32_foc_dev_s *foc_dev = STM32_FOC_DEV_FROM_DEV_GET(dev); + struct stm32_foc_dev_s *foc_dev = STM32_FOC_DEV_FROM_DEV_GET(dev); DEBUGASSERT(dev); DEBUGASSERT(foc_dev); @@ -1452,10 +1452,10 @@ errout: static int stm32_foc_shutdown(struct foc_dev_s *dev) { - struct stm32_foc_dev_s *foc_dev = STM32_FOC_DEV_FROM_DEV_GET(dev); - struct stm32_foc_board_s *board = STM32_FOC_BOARD_FROM_DEV_GET(dev); - struct stm32_foc_priv_s *priv = STM32_FOC_PRIV_FROM_DEV_GET(dev); - int ret = OK; + struct stm32_foc_dev_s *foc_dev = STM32_FOC_DEV_FROM_DEV_GET(dev); + struct stm32_foc_board_s *board = STM32_FOC_BOARD_FROM_DEV_GET(dev); + struct stm32_foc_priv_s *priv = STM32_FOC_PRIV_FROM_DEV_GET(dev); + int ret = OK; DEBUGASSERT(dev); DEBUGASSERT(foc_dev); diff --git a/arch/arm/src/stm32/stm32_hciuart.c b/arch/arm/src/stm32/stm32_hciuart.c index 227782155b..5b04310997 100644 --- a/arch/arm/src/stm32/stm32_hciuart.c +++ b/arch/arm/src/stm32/stm32_hciuart.c @@ -369,20 +369,20 @@ static struct hciuart_state_s g_hciusart1_state = static const struct hciuart_config_s g_hciusart1_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciusart1_state, .rxbuffer = g_usart1_rxbuffer, .txbuffer = g_usart1_txbuffer, #ifdef CONFIG_STM32_HCIUART1_RXDMA - .rxdmabuffer = , + .rxdmabuffer = g_usart1_rxdmabuffer, #endif .rxbufsize = CONFIG_STM32_HCIUART1_RXBUFSIZE, .txbufsize = CONFIG_STM32_HCIUART1_TXBUFSIZE, @@ -433,14 +433,14 @@ static struct hciuart_state_s g_hciusart2_state = static const struct hciuart_config_s g_hciusart2_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciusart2_state, .rxbuffer = g_usart2_rxbuffer, @@ -493,14 +493,14 @@ static struct hciuart_state_s g_hciusart3_state = static const struct hciuart_config_s g_hciusart3_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciusart3_state, .rxbuffer = g_usart3_rxbuffer, @@ -555,14 +555,14 @@ static struct hciuart_state_s g_hciusart6_state = static const struct hciuart_config_s g_hciusart6_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciusart6_state, .rxbuffer = g_usart6_rxbuffer, @@ -615,14 +615,14 @@ static struct hciuart_state_s g_hciuart7_state = static const struct hciuart_config_s g_hciuart7_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart7_state, .rxbuffer = g_uart7_rxbuffer, @@ -675,14 +675,14 @@ static struct hciuart_state_s g_hciuart8_state = static const struct hciuart_config_s g_hciuart8_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart8_state, .rxbuffer = g_uart8_rxbuffer, diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index 392d4fa45b..33cc643c98 100644 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -10,7 +10,7 @@ * Copyright (C) 2011-2014, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * - * Copyright( C) 2014 Patrizio Simona. All rights reserved. + * Copyright (C) 2014 Patrizio Simona. All rights reserved. * Author: Patrizio Simona * * Redistribution and use in source and binary forms, with or without @@ -2233,7 +2233,7 @@ static int stm32_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int stm32_i2c_reset(struct i2c_master_s * dev) +static int stm32_i2c_reset(struct i2c_master_s *dev) { struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev; unsigned int clock_count; diff --git a/arch/arm/src/stm32/stm32_i2c_v2.c b/arch/arm/src/stm32/stm32_i2c_v2.c index bdeccf6f36..e17b537849 100644 --- a/arch/arm/src/stm32/stm32_i2c_v2.c +++ b/arch/arm/src/stm32/stm32_i2c_v2.c @@ -473,7 +473,7 @@ static inline void stm32_i2c_sendstart(struct stm32_i2c_priv_s *priv); static inline void stm32_i2c_sendstop(struct stm32_i2c_priv_s *priv); static inline uint32_t stm32_i2c_getstatus(struct stm32_i2c_priv_s *priv); -static int stm32_i2c_isr_process(struct stm32_i2c_priv_s * priv); +static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv); #ifndef CONFIG_I2C_POLLED static int stm32_i2c_isr(int irq, void *context, void *arg); #endif @@ -485,7 +485,7 @@ static int stm32_i2c_process(struct i2c_master_s *dev, static int stm32_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int stm32_i2c_reset(struct i2c_master_s * dev); +static int stm32_i2c_reset(struct i2c_master_s *dev); #endif #ifdef CONFIG_PM static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain, @@ -2468,11 +2468,18 @@ static int stm32_i2c_process(struct i2c_master_s *dev, static int stm32_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count) { + struct stm32_i2c_priv_s *priv; int ret; + DEBUGASSERT(dev); + + /* Get I2C private structure */ + + priv = ((struct stm32_i2c_inst_s *)dev)->priv; + /* Ensure that address or flags don't change meanwhile */ - ret = nxmutex_lock(&((struct stm32_i2c_inst_s *)dev)->priv->lock); + ret = nxmutex_lock(&priv->lock); if (ret >= 0) { ret = stm32_i2c_process(dev, msgs, count); @@ -2490,7 +2497,7 @@ static int stm32_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int stm32_i2c_reset(struct i2c_master_s * dev) +static int stm32_i2c_reset(struct i2c_master_s *dev) { struct stm32_i2c_priv_s *priv; unsigned int clock_count; diff --git a/arch/arm/src/stm32/stm32_ltdc.c b/arch/arm/src/stm32/stm32_ltdc.c index 2dc5b39d64..dd16b4dff7 100644 --- a/arch/arm/src/stm32/stm32_ltdc.c +++ b/arch/arm/src/stm32/stm32_ltdc.c @@ -682,7 +682,7 @@ static int stm32_ltdc_reload(uint8_t value, bool waitvblank); static void stm32_ltdc_lpixelformat(struct stm32_ltdc_s *layer); static void stm32_ltdc_lframebuffer(struct stm32_ltdc_s *layer); static void stm32_ltdc_lenable(struct stm32_ltdc_s *layer, bool enable); -static void stm32_ltdc_ldefaultcolor(struct stm32_ltdc_s * layer, +static void stm32_ltdc_ldefaultcolor(struct stm32_ltdc_s *layer, uint32_t rgb); static void stm32_ltdc_ltransp(struct stm32_ltdc_s *layer, uint8_t transp, @@ -703,9 +703,9 @@ static bool stm32_ltdc_lvalidate(const struct stm32_ltdc_s *layer, #endif #ifdef CONFIG_STM32_FB_CMAP -static void stm32_ltdc_lputclut(struct stm32_ltdc_s * layer, +static void stm32_ltdc_lputclut(struct stm32_ltdc_s *layer, const struct fb_cmap_s *cmap); -static void stm32_ltdc_lgetclut(struct stm32_ltdc_s * layer, +static void stm32_ltdc_lgetclut(struct stm32_ltdc_s *layer, struct fb_cmap_s *cmap); static void stm32_ltdc_lclutenable(struct stm32_ltdc_s *layer, bool enable); @@ -1339,7 +1339,7 @@ static void stm32_ltdc_periphconfig(void) * ****************************************************************************/ -static void stm32_ltdc_ldefaultcolor(struct stm32_ltdc_s * layer, +static void stm32_ltdc_ldefaultcolor(struct stm32_ltdc_s *layer, uint32_t rgb) { DEBUGASSERT(layer->layerno < LTDC_NLAYERS); @@ -2079,8 +2079,8 @@ static void stm32_ltdc_lputclut(struct stm32_ltdc_s *layer, * ****************************************************************************/ -static void stm32_ltdc_lgetclut(struct stm32_ltdc_s * layer, - struct fb_cmap_s * cmap) +static void stm32_ltdc_lgetclut(struct stm32_ltdc_s *layer, + struct fb_cmap_s *cmap) { int n; struct fb_cmap_s *priv_cmap = &g_vtable.cmap; @@ -2401,7 +2401,7 @@ static int stm32_getcmap(struct fb_vtable_s *vtable, * from the main overlay. */ - struct stm32_ltdc_s * layer; + struct stm32_ltdc_s *layer; # ifdef CONFIG_STM32_LTDC_L2 layer = &priv->layer[LTDC_LAYER_L2]; # else @@ -2488,7 +2488,7 @@ static int stm32_putcmap(struct fb_vtable_s *vtable, for (n = 0; n < LTDC_NLAYERS; n++) { - struct stm32_ltdc_s * layer = &priv->layer[n]; + struct stm32_ltdc_s *layer = &priv->layer[n]; stm32_ltdc_lputclut(layer, priv_cmap); } @@ -2545,7 +2545,7 @@ static int stm32_getoverlayinfo(struct fb_vtable_s *vtable, if (overlayno < LTDC_NOVERLAYS) { - struct stm32_ltdc_s * layer = &priv->layer[overlayno]; + struct stm32_ltdc_s *layer = &priv->layer[overlayno]; memcpy(oinfo, &layer->oinfo, sizeof(struct fb_overlayinfo_s)); return OK; } @@ -2577,7 +2577,7 @@ static int stm32_settransp(struct fb_vtable_s *vtable, if (oinfo->overlay < LTDC_NOVERLAYS) { - struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay]; + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; nxmutex_lock(layer->lock); layer->oinfo.transp.transp = oinfo->transp.transp; @@ -2628,7 +2628,7 @@ static int stm32_setchromakey(struct fb_vtable_s *vtable, if (oinfo->overlay < LTDC_NLAYERS) { int ret; - struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay]; + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; # ifndef CONFIG_STM32_LTDC_L1_CHROMAKEY if (oinfo->overlay == LTDC_LAYER_L1) @@ -2703,8 +2703,8 @@ static int stm32_setcolor(struct fb_vtable_s *vtable, int ret; struct stm32_ltdcdev_s *priv = (struct stm32_ltdcdev_s *) vtable; - struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay]; - struct fb_overlayinfo_s * poverlay = layer->dma2dinfo.oinfo; + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; + struct fb_overlayinfo_s *poverlay = layer->dma2dinfo.oinfo; DEBUGASSERT(&layer->oinfo == poverlay); @@ -2743,7 +2743,7 @@ static int stm32_setblank(struct fb_vtable_s *vtable, if (oinfo->overlay < LTDC_NLAYERS) { - struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay]; + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; nxmutex_lock(layer->lock); layer->oinfo.blank = oinfo->blank; @@ -2794,7 +2794,7 @@ static int stm32_setarea(struct fb_vtable_s *vtable, { struct stm32_ltdcdev_s *priv = (struct stm32_ltdcdev_s *) vtable; - struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay]; + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; nxmutex_lock(layer->lock); memcpy(&layer->oinfo.sarea, &oinfo->sarea, sizeof(struct fb_area_s)); @@ -2968,7 +2968,7 @@ void stm32_ltdcreset(void) int stm32_ltdcinitialize(void) { - int ret = OK; + int ret = OK; lcdinfo("Initialize LTDC driver\n"); diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index 12e51bff72..3b90090764 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -484,8 +484,8 @@ static struct stm32_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = stm32_wait, - .enumerate = stm32_enumerate, + .wait = stm32_wait, + .enumerate = stm32_enumerate, }; /**************************************************************************** @@ -5271,7 +5271,7 @@ static inline void stm32_sw_initialize(struct stm32_usbhost_s *priv) struct stm32_chan_s *chan = &priv->chan[i]; chan->chidx = i; - nxsem_init(&chan->waitsem, 0, 0); + nxsem_init(&chan->waitsem, 0, 0); } } diff --git a/arch/arm/src/stm32/stm32_otghshost.c b/arch/arm/src/stm32/stm32_otghshost.c index 7d595c0971..f7a22cd0eb 100644 --- a/arch/arm/src/stm32/stm32_otghshost.c +++ b/arch/arm/src/stm32/stm32_otghshost.c @@ -489,8 +489,8 @@ static struct stm32_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = stm32_wait, - .enumerate = stm32_enumerate, + .wait = stm32_wait, + .enumerate = stm32_enumerate, }; /**************************************************************************** @@ -5270,7 +5270,7 @@ static inline void stm32_sw_initialize(struct stm32_usbhost_s *priv) struct stm32_chan_s *chan = &priv->chan[i]; chan->chidx = i; - nxsem_init(&chan->waitsem, 0, 0); + nxsem_init(&chan->waitsem, 0, 0); } } diff --git a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c index e192e67a70..ace19b5d39 100644 --- a/arch/arm/src/stm32/stm32_rtc_lowerhalf.c +++ b/arch/arm/src/stm32/stm32_rtc_lowerhalf.c @@ -158,7 +158,7 @@ static const struct rtc_ops_s g_rtc_ops = static struct stm32_lowerhalf_s g_rtc_lowerhalf = { - .ops = &g_rtc_ops, + .ops = &g_rtc_ops, .devlock = NXMUTEX_INITIALIZER, }; diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index 2490e7e112..063bbfcd92 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -349,9 +349,9 @@ static uint8_t g_spi1_rxbuf[SPI1_DMABUFSIZE_ADJUSTED] SPI1_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi1dev = { .spidev = - { - &g_sp1iops - }, + { + .ops = &g_sp1iops + }, .spibase = STM32_SPI1_BASE, .spiclock = STM32_PCLK2_FREQUENCY, #ifdef CONFIG_STM32_SPI_INTERRUPTS @@ -361,7 +361,7 @@ static struct stm32_spidev_s g_spi1dev = # ifdef CONFIG_STM32_SPI1_DMA .rxch = DMACHAN_SPI1_RX, .txch = DMACHAN_SPI1_TX, -#if defined(SPI1_DMABUFSIZE_ADJUSTED) +# ifdef SPI1_DMABUFSIZE_ADJUSTED .rxbuf = g_spi1_rxbuf, .txbuf = g_spi1_txbuf, .buflen = SPI1_DMABUFSIZE_ADJUSTED, @@ -417,9 +417,9 @@ static uint8_t g_spi2_rxbuf[SPI2_DMABUFSIZE_ADJUSTED] SPI2_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi2dev = { .spidev = - { - &g_sp2iops - }, + { + .ops = &g_sp2iops + }, .spibase = STM32_SPI2_BASE, .spiclock = STM32_PCLK1_FREQUENCY, #ifdef CONFIG_STM32_SPI_INTERRUPTS @@ -429,7 +429,7 @@ static struct stm32_spidev_s g_spi2dev = # ifdef CONFIG_STM32_SPI2_DMA .rxch = DMACHAN_SPI2_RX, .txch = DMACHAN_SPI2_TX, -#if defined(SPI2_DMABUFSIZE_ADJUSTED) +# ifdef SPI2_DMABUFSIZE_ADJUSTED .rxbuf = g_spi2_rxbuf, .txbuf = g_spi2_txbuf, .buflen = SPI2_DMABUFSIZE_ADJUSTED, @@ -485,9 +485,9 @@ static uint8_t g_spi3_rxbuf[SPI3_DMABUFSIZE_ADJUSTED] SPI3_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi3dev = { .spidev = - { - &g_sp3iops - }, + { + .ops = &g_sp3iops + }, .spibase = STM32_SPI3_BASE, .spiclock = STM32_PCLK1_FREQUENCY, #ifdef CONFIG_STM32_SPI_INTERRUPTS @@ -497,7 +497,7 @@ static struct stm32_spidev_s g_spi3dev = # ifdef CONFIG_STM32_SPI3_DMA .rxch = DMACHAN_SPI3_RX, .txch = DMACHAN_SPI3_TX, -#if defined(SPI3_DMABUFSIZE_ADJUSTED) +# ifdef SPI3_DMABUFSIZE_ADJUSTED .rxbuf = g_spi3_rxbuf, .txbuf = g_spi3_txbuf, .buflen = SPI3_DMABUFSIZE_ADJUSTED, @@ -553,9 +553,9 @@ static uint8_t g_spi4_rxbuf[SPI4_DMABUFSIZE_ADJUSTED] SPI4_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi4dev = { .spidev = - { - &g_sp4iops - }, + { + .ops = &g_sp4iops + }, .spibase = STM32_SPI4_BASE, .spiclock = STM32_PCLK2_FREQUENCY, #ifdef CONFIG_STM32_SPI_INTERRUPTS @@ -565,7 +565,7 @@ static struct stm32_spidev_s g_spi4dev = # ifdef CONFIG_STM32_SPI4_DMA .rxch = DMACHAN_SPI4_RX, .txch = DMACHAN_SPI4_TX, -#if defined(SPI4_DMABUFSIZE_ADJUSTED) +# ifdef SPI4_DMABUFSIZE_ADJUSTED .rxbuf = g_spi4_rxbuf, .txbuf = g_spi4_txbuf, .buflen = SPI4_DMABUFSIZE_ADJUSTED, @@ -621,9 +621,9 @@ static uint8_t g_spi5_rxbuf[SPI5_DMABUFSIZE_ADJUSTED] SPI5_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi5dev = { .spidev = - { - &g_sp5iops - }, + { + .ops = &g_sp5iops + }, .spibase = STM32_SPI5_BASE, .spiclock = STM32_PCLK2_FREQUENCY, #ifdef CONFIG_STM32_SPI_INTERRUPTS @@ -633,7 +633,7 @@ static struct stm32_spidev_s g_spi5dev = # ifdef CONFIG_STM32_SPI5_DMA .rxch = DMACHAN_SPI5_RX, .txch = DMACHAN_SPI5_TX, -#if defined(SPI5_DMABUFSIZE_ADJUSTED) +# ifdef SPI5_DMABUFSIZE_ADJUSTED .rxbuf = g_spi5_rxbuf, .txbuf = g_spi5_txbuf, .buflen = SPI5_DMABUFSIZE_ADJUSTED, @@ -689,9 +689,9 @@ static uint8_t g_spi6_rxbuf[SPI6_DMABUFSIZE_ADJUSTED] SPI6_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi6dev = { .spidev = - { - &g_sp6iops - }, + { + .ops = &g_sp6iops + }, .spibase = STM32_SPI6_BASE, .spiclock = STM32_PCLK2_FREQUENCY, #ifdef CONFIG_STM32_SPI_INTERRUPTS @@ -701,7 +701,7 @@ static struct stm32_spidev_s g_spi6dev = # ifdef CONFIG_STM32_SPI6_DMA .rxch = DMACHAN_SPI6_RX, .txch = DMACHAN_SPI6_TX, -#if defined(SPI6_DMABUFSIZE_ADJUSTED) +# ifdef SPI6_DMABUFSIZE_ADJUSTED .rxbuf = g_spi6_rxbuf, .txbuf = g_spi6_txbuf, .buflen = SPI6_DMABUFSIZE_ADJUSTED, diff --git a/arch/arm/src/stm32f0l0g0/stm32_i2c.c b/arch/arm/src/stm32f0l0g0/stm32_i2c.c index efeb8813d0..4f34ed1c99 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_i2c.c +++ b/arch/arm/src/stm32f0l0g0/stm32_i2c.c @@ -474,7 +474,7 @@ static inline void stm32_i2c_sendstart(struct stm32_i2c_priv_s *priv); static inline void stm32_i2c_sendstop(struct stm32_i2c_priv_s *priv); static inline uint32_t stm32_i2c_getstatus(struct stm32_i2c_priv_s *priv); -static int stm32_i2c_isr_process(struct stm32_i2c_priv_s * priv); +static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv); #ifndef CONFIG_I2C_POLLED static int stm32_i2c_isr(int irq, void *context, void *arg); #endif @@ -486,7 +486,7 @@ static int stm32_i2c_process(struct i2c_master_s *dev, static int stm32_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int stm32_i2c_reset(struct i2c_master_s * dev); +static int stm32_i2c_reset(struct i2c_master_s *dev); #endif #ifdef CONFIG_PM static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, @@ -2464,11 +2464,18 @@ static int stm32_i2c_process(struct i2c_master_s *dev, static int stm32_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count) { + struct stm32_i2c_priv_s *priv; int ret; + DEBUGASSERT(dev); + + /* Get I2C private structure */ + + priv = ((struct stm32_i2c_inst_s *)dev)->priv; + /* Ensure that address or flags don't change meanwhile */ - ret = nxmutex_lock(&((struct stm32_i2c_inst_s *)dev)->priv->lock); + ret = nxmutex_lock(&priv->lock); if (ret >= 0) { ret = stm32_i2c_process(dev, msgs, count); @@ -2486,7 +2493,7 @@ static int stm32_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int stm32_i2c_reset(struct i2c_master_s * dev) +static int stm32_i2c_reset(struct i2c_master_s *dev) { struct stm32_i2c_priv_s *priv; unsigned int clock_count; diff --git a/arch/arm/src/stm32f0l0g0/stm32_spi.c b/arch/arm/src/stm32f0l0g0/stm32_spi.c index 3d85ee99da..136680731b 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_spi.c +++ b/arch/arm/src/stm32f0l0g0/stm32_spi.c @@ -312,9 +312,9 @@ static const struct spi_ops_s g_spi1ops = static struct stm32_spidev_s g_spi1dev = { .spidev = - { - &g_spi1ops - }, + { + .ops = &g_spi1ops, + }, .spibase = STM32_SPI1_BASE, .spiclock = SPI1_PCLK_FREQUENCY, #ifdef CONFIG_STM32F0L0G0_SPI_INTERRUPTS @@ -371,9 +371,9 @@ static const struct spi_ops_s g_spi2ops = static struct stm32_spidev_s g_spi2dev = { .spidev = - { - &g_spi2ops - }, + { + .ops = &g_spi2ops, + }, .spibase = STM32_SPI2_BASE, .spiclock = SPI1_PCLK_FREQUENCY, #ifdef CONFIG_STM32F0L0G0_SPI_INTERRUPTS @@ -428,9 +428,9 @@ static const struct spi_ops_s g_spi3ops = static struct stm32_spidev_s g_spi3dev = { .spidev = - { - &g_spi3ops - }, + { + .ops = &g_spi3ops, + }, .spibase = STM32_SPI3_BASE, .spiclock = SPI1_PCLK_FREQUENCY, #ifdef CONFIG_STM32F0L0G0_SPI_INTERRUPTS diff --git a/arch/arm/src/stm32f7/stm32_adc.c b/arch/arm/src/stm32f7/stm32_adc.c index 7f9e802bd2..1b55b9a0dc 100644 --- a/arch/arm/src/stm32f7/stm32_adc.c +++ b/arch/arm/src/stm32f7/stm32_adc.c @@ -307,7 +307,7 @@ static void adc_enable(struct stm32_dev_s *priv, bool enable); static uint32_t adc_sqrbits(struct stm32_dev_s *priv, int first, int last, int offset); static int adc_set_ch(struct adc_dev_s *dev, uint8_t ch); -static bool adc_internal(struct stm32_dev_s * priv); +static bool adc_internal(struct stm32_dev_s *priv); static int adc_resolution_set(struct adc_dev_s *dev, uint8_t res); @@ -930,7 +930,7 @@ static int adc_timinit(struct stm32_dev_s *priv) * 0 <= prescaler <= 65536 * 1 <= reload <= 65535 * - * So ( prescaler = pclck / 65535 / freq ) would be optimal. + * So (prescaler = pclck / 65535 / freq) would be optimal. */ prescaler = (priv->pclck / priv->freq + 65534) / 65535; @@ -2158,7 +2158,7 @@ static uint32_t adc_sqrbits(struct stm32_dev_s *priv, int first, * Name: adc_internal ****************************************************************************/ -static bool adc_internal(struct stm32_dev_s * priv) +static bool adc_internal(struct stm32_dev_s *priv) { int i; diff --git a/arch/arm/src/stm32f7/stm32_dma2d.c b/arch/arm/src/stm32f7/stm32_dma2d.c index 3c29fecda4..d3cb6fc867 100644 --- a/arch/arm/src/stm32f7/stm32_dma2d.c +++ b/arch/arm/src/stm32f7/stm32_dma2d.c @@ -461,8 +461,8 @@ static int stm32_dma2d_waitforirq(void) #ifdef CONFIG_STM32F7_DMA2D_L8 static int stm32_dma2d_loadclut(uintptr_t pfcreg) { - int ret; - uint32_t regval; + int ret; + uint32_t regval; /* Start clut loading */ @@ -495,7 +495,7 @@ static int stm32_dma2d_loadclut(uintptr_t pfcreg) static int stm32_dma2d_start(void) { - int ret; + int ret; /* Start dma transfer */ @@ -681,7 +681,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha, #ifdef CONFIG_STM32F7_FB_CMAP if (fmt == DMA2D_PF_L8) { - struct stm32_dma2d_s * layer = &g_dma2ddev; + struct stm32_dma2d_s *layer = &g_dma2ddev; /* Load CLUT automatically */ @@ -745,7 +745,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha, static int stm32_dma2d_setclut(const struct fb_cmap_s *cmap) { int n; - struct stm32_dma2d_s * priv = &g_dma2ddev; + struct stm32_dma2d_s *priv = &g_dma2ddev; lcdinfo("cmap=%p\n", cmap); @@ -814,7 +814,7 @@ static int stm32_dma2d_fillcolor(struct stm32_dma2d_overlay_s *oinfo, uint32_t argb) { int ret; - struct stm32_dma2d_s * priv = &g_dma2ddev; + struct stm32_dma2d_s *priv = &g_dma2ddev; DEBUGASSERT(oinfo != NULL && oinfo->oinfo != NULL && area != NULL); lcdinfo("oinfo=%p, argb=%08x\n", oinfo, argb); @@ -895,9 +895,9 @@ static int stm32_dma2d_blit(struct stm32_dma2d_overlay_s *doverlay, struct stm32_dma2d_overlay_s *soverlay, const struct fb_area_s *sarea) { - int ret; - uint32_t mode; - struct stm32_dma2d_s * priv = &g_dma2ddev; + int ret; + uint32_t mode; + struct stm32_dma2d_s *priv = &g_dma2ddev; lcdinfo("doverlay=%p, destxpos=%d, destypos=%d, soverlay=%p, sarea=%p\n", doverlay, destxpos, destypos, soverlay, sarea); @@ -994,8 +994,8 @@ static int stm32_dma2d_blend(struct stm32_dma2d_overlay_s *doverlay, struct stm32_dma2d_overlay_s *boverlay, const struct fb_area_s *barea) { - int ret; - struct stm32_dma2d_s * priv = &g_dma2ddev; + int ret; + struct stm32_dma2d_s *priv = &g_dma2ddev; lcdinfo("doverlay=%p, destxpos=%d, destypos=%d, " "foverlay=%p, forexpos=%d, foreypos=%d, " diff --git a/arch/arm/src/stm32f7/stm32_foc.c b/arch/arm/src/stm32f7/stm32_foc.c index 7034fff68b..be44c8aa40 100644 --- a/arch/arm/src/stm32f7/stm32_foc.c +++ b/arch/arm/src/stm32f7/stm32_foc.c @@ -936,7 +936,7 @@ static int stm32_foc_adc_start(struct foc_dev_s *dev, bool state) static int stm32_foc_adc_cfg(struct foc_dev_s *dev) { - struct stm32_foc_dev_s *foc_dev = STM32_FOCDEV_FROM_DEV_GET(dev); + struct stm32_foc_dev_s *foc_dev = STM32_FOCDEV_FROM_DEV_GET(dev); DEBUGASSERT(dev); DEBUGASSERT(foc_dev); @@ -1248,10 +1248,10 @@ errout: static int stm32_foc_shutdown(struct foc_dev_s *dev) { - struct stm32_foc_dev_s *foc_dev = STM32_FOCDEV_FROM_DEV_GET(dev); - struct stm32_foc_board_s *board = STM32_FOCBOARD_FROM_DEV_GET(dev); - struct stm32_foc_priv_s *priv = STM32_FOCPRIV_FROM_DEV_GET(dev); - int ret = OK; + struct stm32_foc_dev_s *foc_dev = STM32_FOCDEV_FROM_DEV_GET(dev); + struct stm32_foc_board_s *board = STM32_FOCBOARD_FROM_DEV_GET(dev); + struct stm32_foc_priv_s *priv = STM32_FOCPRIV_FROM_DEV_GET(dev); + int ret = OK; DEBUGASSERT(dev); DEBUGASSERT(foc_dev); diff --git a/arch/arm/src/stm32f7/stm32_i2c.c b/arch/arm/src/stm32f7/stm32_i2c.c index ae0a38cb3c..6a629f6da8 100644 --- a/arch/arm/src/stm32f7/stm32_i2c.c +++ b/arch/arm/src/stm32f7/stm32_i2c.c @@ -522,7 +522,7 @@ static int stm32_i2c_process(struct i2c_master_s *dev, static int stm32_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int stm32_i2c_reset(struct i2c_master_s * dev); +static int stm32_i2c_reset(struct i2c_master_s *dev); #endif #ifdef CONFIG_PM static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain, @@ -2505,11 +2505,18 @@ static int stm32_i2c_process(struct i2c_master_s *dev, static int stm32_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count) { + struct stm32_i2c_priv_s *priv; int ret; + DEBUGASSERT(dev); + + /* Get I2C private structure */ + + priv = ((struct stm32_i2c_inst_s *)dev)->priv; + /* Ensure that address or flags don't change meanwhile */ - ret = nxmutex_lock(&((struct stm32_i2c_inst_s *)dev)->priv->lock); + ret = nxmutex_lock(&priv->lock); if (ret >= 0) { ret = stm32_i2c_process(dev, msgs, count); @@ -2527,7 +2534,7 @@ static int stm32_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int stm32_i2c_reset(struct i2c_master_s * dev) +static int stm32_i2c_reset(struct i2c_master_s *dev) { struct stm32_i2c_priv_s *priv; unsigned int clock_count; diff --git a/arch/arm/src/stm32f7/stm32_ltdc.c b/arch/arm/src/stm32f7/stm32_ltdc.c index 41df28c1f6..4f108a833e 100644 --- a/arch/arm/src/stm32f7/stm32_ltdc.c +++ b/arch/arm/src/stm32f7/stm32_ltdc.c @@ -683,7 +683,7 @@ static int stm32_ltdc_reload(uint8_t value, bool waitvblank); static void stm32_ltdc_lpixelformat(struct stm32_ltdc_s *layer); static void stm32_ltdc_lframebuffer(struct stm32_ltdc_s *layer); static void stm32_ltdc_lenable(struct stm32_ltdc_s *layer, bool enable); -static void stm32_ltdc_ldefaultcolor(struct stm32_ltdc_s * layer, +static void stm32_ltdc_ldefaultcolor(struct stm32_ltdc_s *layer, uint32_t rgb); static void stm32_ltdc_ltransp(struct stm32_ltdc_s *layer, uint8_t transp, @@ -704,9 +704,9 @@ static bool stm32_ltdc_lvalidate(const struct stm32_ltdc_s *layer, #endif #ifdef CONFIG_STM32F7_FB_CMAP -static void stm32_ltdc_lputclut(struct stm32_ltdc_s * layer, +static void stm32_ltdc_lputclut(struct stm32_ltdc_s *layer, const struct fb_cmap_s *cmap); -static void stm32_ltdc_lgetclut(struct stm32_ltdc_s * layer, +static void stm32_ltdc_lgetclut(struct stm32_ltdc_s *layer, struct fb_cmap_s *cmap); static void stm32_ltdc_lclutenable(struct stm32_ltdc_s *layer, bool enable); @@ -1342,7 +1342,7 @@ static void stm32_ltdc_periphconfig(void) * ****************************************************************************/ -static void stm32_ltdc_ldefaultcolor(struct stm32_ltdc_s * layer, +static void stm32_ltdc_ldefaultcolor(struct stm32_ltdc_s *layer, uint32_t rgb) { DEBUGASSERT(layer->layerno < LTDC_NLAYERS); @@ -2081,8 +2081,8 @@ static void stm32_ltdc_lputclut(struct stm32_ltdc_s *layer, * ****************************************************************************/ -static void stm32_ltdc_lgetclut(struct stm32_ltdc_s * layer, - struct fb_cmap_s * cmap) +static void stm32_ltdc_lgetclut(struct stm32_ltdc_s *layer, + struct fb_cmap_s *cmap) { int n; struct fb_cmap_s *priv_cmap = &g_vtable.cmap; @@ -2403,7 +2403,7 @@ static int stm32_getcmap(struct fb_vtable_s *vtable, * from the main overlay. */ - struct stm32_ltdc_s * layer; + struct stm32_ltdc_s *layer; # ifdef CONFIG_STM32F7_LTDC_L2 layer = &priv->layer[LTDC_LAYER_L2]; # else @@ -2490,7 +2490,7 @@ static int stm32_putcmap(struct fb_vtable_s *vtable, for (n = 0; n < LTDC_NLAYERS; n++) { - struct stm32_ltdc_s * layer = &priv->layer[n]; + struct stm32_ltdc_s *layer = &priv->layer[n]; stm32_ltdc_lputclut(layer, priv_cmap); } @@ -2547,7 +2547,7 @@ static int stm32_getoverlayinfo(struct fb_vtable_s *vtable, if (overlayno < LTDC_NOVERLAYS) { - struct stm32_ltdc_s * layer = &priv->layer[overlayno]; + struct stm32_ltdc_s *layer = &priv->layer[overlayno]; memcpy(oinfo, &layer->oinfo, sizeof(struct fb_overlayinfo_s)); return OK; } @@ -2579,7 +2579,7 @@ static int stm32_settransp(struct fb_vtable_s *vtable, if (oinfo->overlay < LTDC_NOVERLAYS) { - struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay]; + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; nxmutex_lock(layer->lock); layer->oinfo.transp.transp = oinfo->transp.transp; @@ -2630,7 +2630,7 @@ static int stm32_setchromakey(struct fb_vtable_s *vtable, if (oinfo->overlay < LTDC_NLAYERS) { int ret; - struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay]; + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; # ifndef CONFIG_STM32F7_LTDC_L1_CHROMAKEY if (oinfo->overlay == LTDC_LAYER_L1) @@ -2703,8 +2703,8 @@ static int stm32_setcolor(struct fb_vtable_s *vtable, int ret; struct stm32_ltdcdev_s *priv = (struct stm32_ltdcdev_s *)vtable; - struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay]; - struct fb_overlayinfo_s * poverlay = layer->dma2dinfo.oinfo; + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; + struct fb_overlayinfo_s *poverlay = layer->dma2dinfo.oinfo; DEBUGASSERT(&layer->oinfo == poverlay); @@ -2742,7 +2742,7 @@ static int stm32_setblank(struct fb_vtable_s *vtable, if (oinfo->overlay < LTDC_NLAYERS) { - struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay]; + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; nxmutex_lock(layer->lock); layer->oinfo.blank = oinfo->blank; @@ -2793,7 +2793,7 @@ static int stm32_setarea(struct fb_vtable_s *vtable, { struct stm32_ltdcdev_s *priv = (struct stm32_ltdcdev_s *)vtable; - struct stm32_ltdc_s * layer = + struct stm32_ltdc_s *layer = &priv->layer[oinfo->overlay]; nxmutex_lock(layer->lock); @@ -2970,7 +2970,7 @@ void stm32_ltdcreset(void) int stm32_ltdcinitialize(void) { - int ret = OK; + int ret = OK; lcdinfo("Initialize LTDC driver\n"); diff --git a/arch/arm/src/stm32f7/stm32_otghost.c b/arch/arm/src/stm32f7/stm32_otghost.c index c8b7bc3279..80cdd70c58 100644 --- a/arch/arm/src/stm32f7/stm32_otghost.c +++ b/arch/arm/src/stm32f7/stm32_otghost.c @@ -483,8 +483,8 @@ static struct stm32_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = stm32_wait, - .enumerate = stm32_enumerate, + .wait = stm32_wait, + .enumerate = stm32_enumerate, }; /**************************************************************************** @@ -5243,7 +5243,7 @@ static inline void stm32_sw_initialize(struct stm32_usbhost_s *priv) struct stm32_chan_s *chan = &priv->chan[i]; chan->chidx = i; - nxsem_init(&chan->waitsem, 0, 0); + nxsem_init(&chan->waitsem, 0, 0); } } diff --git a/arch/arm/src/stm32f7/stm32_qspi.c b/arch/arm/src/stm32f7/stm32_qspi.c index 833178bcf7..20285f0d19 100644 --- a/arch/arm/src/stm32f7/stm32_qspi.c +++ b/arch/arm/src/stm32f7/stm32_qspi.c @@ -335,7 +335,7 @@ static const struct qspi_ops_s g_qspi0ops = static struct stm32f7_qspidev_s g_qspi0dev = { - .qspi = + .qspi = { .ops = &g_qspi0ops, }, diff --git a/arch/arm/src/stm32f7/stm32_sdmmc.c b/arch/arm/src/stm32f7/stm32_sdmmc.c index 241563c06e..1277aba441 100644 --- a/arch/arm/src/stm32f7/stm32_sdmmc.c +++ b/arch/arm/src/stm32f7/stm32_sdmmc.c @@ -1598,7 +1598,7 @@ static int stm32_sdmmc_interrupt(int irq, void *context, void *arg) #ifdef HAVE_SDMMC_SDIO_MODE uint32_t mask; #endif - struct stm32_dev_s *priv = (struct stm32_dev_s *) arg; + struct stm32_dev_s *priv = (struct stm32_dev_s *)arg; DEBUGASSERT(priv != NULL); diff --git a/arch/arm/src/stm32f7/stm32_spi.c b/arch/arm/src/stm32f7/stm32_spi.c index 40af5410e5..99b9efe2b5 100644 --- a/arch/arm/src/stm32f7/stm32_spi.c +++ b/arch/arm/src/stm32f7/stm32_spi.c @@ -330,7 +330,7 @@ static struct stm32_spidev_s g_spi1dev = { .spidev = { - &g_sp1iops + .ops = &g_sp1iops, }, .spibase = STM32_SPI1_BASE, .spiclock = STM32_PCLK2_FREQUENCY, @@ -341,7 +341,7 @@ static struct stm32_spidev_s g_spi1dev = # ifdef CONFIG_STM32F7_SPI1_DMA .rxch = DMAMAP_SPI1_RX, .txch = DMAMAP_SPI1_TX, -#if defined(SPI1_DMABUFSIZE_ADJUSTED) +# ifdef SPI1_DMABUFSIZE_ADJUSTED .rxbuf = g_spi1_rxbuf, .txbuf = g_spi1_txbuf, .buflen = SPI1_DMABUFSIZE_ADJUSTED, @@ -401,7 +401,7 @@ static struct stm32_spidev_s g_spi2dev = { .spidev = { - &g_sp2iops + .ops = &g_sp2iops, }, .spibase = STM32_SPI2_BASE, .spiclock = STM32_PCLK1_FREQUENCY, @@ -412,7 +412,7 @@ static struct stm32_spidev_s g_spi2dev = # ifdef CONFIG_STM32F7_SPI2_DMA .rxch = DMAMAP_SPI2_RX, .txch = DMAMAP_SPI2_TX, -#if defined(SPI2_DMABUFSIZE_ADJUSTED) +# ifdef SPI3_DMABUFSIZE_ADJUSTED .rxbuf = g_spi2_rxbuf, .txbuf = g_spi2_txbuf, .buflen = SPI2_DMABUFSIZE_ADJUSTED, @@ -472,7 +472,7 @@ static struct stm32_spidev_s g_spi3dev = { .spidev = { - &g_sp3iops + .ops = &g_sp3iops, }, .spibase = STM32_SPI3_BASE, .spiclock = STM32_PCLK1_FREQUENCY, @@ -483,7 +483,7 @@ static struct stm32_spidev_s g_spi3dev = # ifdef CONFIG_STM32F7_SPI3_DMA .rxch = DMAMAP_SPI3_RX, .txch = DMAMAP_SPI3_TX, -#if defined(SPI3_DMABUFSIZE_ADJUSTED) +# ifdef SPI3_DMABUFSIZE_ADJUSTED .rxbuf = g_spi3_rxbuf, .txbuf = g_spi3_txbuf, .buflen = SPI3_DMABUFSIZE_ADJUSTED, @@ -543,7 +543,7 @@ static struct stm32_spidev_s g_spi4dev = { .spidev = { - &g_sp4iops + .ops = &g_sp4iops, }, .spibase = STM32_SPI4_BASE, .spiclock = STM32_PCLK2_FREQUENCY, @@ -554,7 +554,7 @@ static struct stm32_spidev_s g_spi4dev = # ifdef CONFIG_STM32F7_SPI4_DMA .rxch = DMAMAP_SPI4_RX, .txch = DMAMAP_SPI4_TX, -#if defined(SPI4_DMABUFSIZE_ADJUSTED) +# ifdef SPI4_DMABUFSIZE_ADJUSTED .rxbuf = g_spi4_rxbuf, .txbuf = g_spi4_txbuf, .buflen = SPI4_DMABUFSIZE_ADJUSTED, @@ -614,7 +614,7 @@ static struct stm32_spidev_s g_spi5dev = { .spidev = { - &g_sp5iops + .ops = &g_sp5iops, }, .spibase = STM32_SPI5_BASE, .spiclock = STM32_PCLK2_FREQUENCY, @@ -625,7 +625,7 @@ static struct stm32_spidev_s g_spi5dev = # ifdef CONFIG_STM32F7_SPI5_DMA .rxch = DMAMAP_SPI5_RX, .txch = DMAMAP_SPI5_TX, -#if defined(SPI5_DMABUFSIZE_ADJUSTED) +# ifdef SPI5_DMABUFSIZE_ADJUSTED .rxbuf = g_spi5_rxbuf, .txbuf = g_spi5_txbuf, .buflen = SPI5_DMABUFSIZE_ADJUSTED, @@ -685,7 +685,7 @@ static struct stm32_spidev_s g_spi6dev = { .spidev = { - &g_sp6iops + .ops = &g_sp6iops, }, .spibase = STM32_SPI6_BASE, .spiclock = STM32_PCLK2_FREQUENCY, @@ -696,7 +696,7 @@ static struct stm32_spidev_s g_spi6dev = # ifdef CONFIG_STM32F7_SPI6_DMA .rxch = DMAMAP_SPI6_RX, .txch = DMAMAP_SPI6_TX, -#if defined(SPI6_DMABUFSIZE_ADJUSTED) +# ifdef SPI6_DMABUFSIZE_ADJUSTED .rxbuf = g_spi6_rxbuf, .txbuf = g_spi6_txbuf, .buflen = SPI6_DMABUFSIZE_ADJUSTED, @@ -1805,7 +1805,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, void *rxbuffer, size_t nwords) { struct stm32_spidev_s *priv = (struct stm32_spidev_s *)dev; - void * xbuffer = rxbuffer; + void *xbuffer = rxbuffer; int ret; DEBUGASSERT(priv != NULL); diff --git a/arch/arm/src/stm32h7/stm32_i2c.c b/arch/arm/src/stm32h7/stm32_i2c.c index e12cd3fb75..87736a2a4a 100644 --- a/arch/arm/src/stm32h7/stm32_i2c.c +++ b/arch/arm/src/stm32h7/stm32_i2c.c @@ -481,7 +481,7 @@ static int stm32_i2c_process(struct i2c_master_s *dev, static int stm32_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count); #ifdef CONFIG_I2C_RESET -static int stm32_i2c_reset(struct i2c_master_s * dev); +static int stm32_i2c_reset(struct i2c_master_s *dev); #endif #ifdef CONFIG_PM static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain, @@ -2469,11 +2469,18 @@ static int stm32_i2c_process(struct i2c_master_s *dev, static int stm32_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgs, int count) { + struct stm32_i2c_priv_s *priv; int ret; + DEBUGASSERT(dev); + + /* Get I2C private structure */ + + priv = ((struct stm32_i2c_inst_s *)dev)->priv; + /* Ensure that address or flags don't change meanwhile */ - ret = nxmutex_lock(&((struct stm32_i2c_inst_s *)dev)->priv->lock); + ret = nxmutex_lock(&priv->lock); if (ret >= 0) { ret = stm32_i2c_process(dev, msgs, count); @@ -2491,7 +2498,7 @@ static int stm32_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int stm32_i2c_reset(struct i2c_master_s * dev) +static int stm32_i2c_reset(struct i2c_master_s *dev) { struct stm32_i2c_priv_s *priv; unsigned int clock_count; diff --git a/arch/arm/src/stm32h7/stm32_otghost.c b/arch/arm/src/stm32h7/stm32_otghost.c index 48e14e6b30..c3be17f89f 100644 --- a/arch/arm/src/stm32h7/stm32_otghost.c +++ b/arch/arm/src/stm32h7/stm32_otghost.c @@ -485,8 +485,8 @@ static struct stm32_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = stm32_wait, - .enumerate = stm32_enumerate, + .wait = stm32_wait, + .enumerate = stm32_enumerate, }; /**************************************************************************** @@ -5247,7 +5247,7 @@ static inline void stm32_sw_initialize(struct stm32_usbhost_s *priv) struct stm32_chan_s *chan = &priv->chan[i]; chan->chidx = i; - nxsem_init(&chan->waitsem, 0, 0); + nxsem_init(&chan->waitsem, 0, 0); } } diff --git a/arch/arm/src/stm32h7/stm32_qspi.c b/arch/arm/src/stm32h7/stm32_qspi.c index d073889af9..2566d5ac3b 100644 --- a/arch/arm/src/stm32h7/stm32_qspi.c +++ b/arch/arm/src/stm32h7/stm32_qspi.c @@ -360,7 +360,7 @@ static const struct qspi_ops_s g_qspi0ops = static struct stm32h7_qspidev_s g_qspi0dev = { - .qspi = + .qspi = { .ops = &g_qspi0ops, }, diff --git a/arch/arm/src/stm32h7/stm32_rtc_lowerhalf.c b/arch/arm/src/stm32h7/stm32_rtc_lowerhalf.c index 700080cafb..953f50e660 100644 --- a/arch/arm/src/stm32h7/stm32_rtc_lowerhalf.c +++ b/arch/arm/src/stm32h7/stm32_rtc_lowerhalf.c @@ -155,7 +155,7 @@ static const struct rtc_ops_s g_rtc_ops = static struct stm32_lowerhalf_s g_rtc_lowerhalf = { - .ops = &g_rtc_ops, + .ops = &g_rtc_ops, .devlock = NXMUTEX_INITIALIZER, }; diff --git a/arch/arm/src/stm32h7/stm32_sdmmc.c b/arch/arm/src/stm32h7/stm32_sdmmc.c index d2a23c7c1a..91885fb1e5 100644 --- a/arch/arm/src/stm32h7/stm32_sdmmc.c +++ b/arch/arm/src/stm32h7/stm32_sdmmc.c @@ -588,14 +588,14 @@ struct stm32_dev_s g_sdmmcdev1 = .dmasendsetup = stm32_dmasendsetup, #endif }, - .base = STM32_SDMMC1_BASE, - .nirq = STM32_IRQ_SDMMC1, + .base = STM32_SDMMC1_BASE, + .nirq = STM32_IRQ_SDMMC1, #if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE) - .d0_gpio = SDMMC1_SDIO_PULL(GPIO_SDMMC1_D0), + .d0_gpio = SDMMC1_SDIO_PULL(GPIO_SDMMC1_D0), #endif .waitsem = SEM_INITIALIZER(0), #if defined(HAVE_SDMMC_SDIO_MODE) && defined(CONFIG_SDMMC1_SDIO_MODE) - .sdiomode = true, + .sdiomode = true, #endif }; #endif @@ -643,14 +643,14 @@ struct stm32_dev_s g_sdmmcdev2 = .dmasendsetup = stm32_dmasendsetup, #endif }, - .base = STM32_SDMMC2_BASE, - .nirq = STM32_IRQ_SDMMC2, + .base = STM32_SDMMC2_BASE, + .nirq = STM32_IRQ_SDMMC2, #if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE) - .d0_gpio = SDMMC2_SDIO_PULL(GPIO_SDMMC2_D0), + .d0_gpio = SDMMC2_SDIO_PULL(GPIO_SDMMC2_D0), #endif .waitsem = SEM_INITIALIZER(0), #if defined(HAVE_SDMMC_SDIO_MODE) && defined(CONFIG_SDMMC2_SDIO_MODE) - .sdiomode = true, + .sdiomode = true, #endif }; #endif diff --git a/arch/arm/src/stm32h7/stm32_serial.c b/arch/arm/src/stm32h7/stm32_serial.c index 7a8ea71f12..7cc366e764 100644 --- a/arch/arm/src/stm32h7/stm32_serial.c +++ b/arch/arm/src/stm32h7/stm32_serial.c @@ -919,31 +919,31 @@ static char g_uart8txbuffer[UART8_TXBUFSIZE_ADJUSTED] \ static struct up_dev_s g_usart1priv = { .dev = - { + { #if CONSOLE_UART == 1 - .isconsole = true, + .isconsole = true, #endif - .recv = - { - .size = sizeof(g_usart1rxbuffer), - .buffer = g_usart1rxbuffer, - }, - .xmit = - { - .size = sizeof(g_usart1txbuffer), - .buffer = g_usart1txbuffer, - }, -#if defined(CONFIG_USART1_RXDMA) && defined(CONFIG_USART1_TXDMA) - .ops = &g_uart_rxtxdma_ops, -#elif defined(CONFIG_USART1_RXDMA) && !defined(CONFIG_USART1_TXDMA) - .ops = &g_uart_rxdma_ops, -#elif !defined(CONFIG_USART1_RXDMA) && defined(CONFIG_USART1_TXDMA) - .ops = &g_uart_txdma_ops, -#else - .ops = &g_uart_ops, -#endif - .priv = &g_usart1priv, + .recv = + { + .size = sizeof(g_usart1rxbuffer), + .buffer = g_usart1rxbuffer, }, + .xmit = + { + .size = sizeof(g_usart1txbuffer), + .buffer = g_usart1txbuffer, + }, +#if defined(CONFIG_USART1_RXDMA) && defined(CONFIG_USART1_TXDMA) + .ops = &g_uart_rxtxdma_ops, +#elif defined(CONFIG_USART1_RXDMA) && !defined(CONFIG_USART1_TXDMA) + .ops = &g_uart_rxdma_ops, +#elif !defined(CONFIG_USART1_RXDMA) && defined(CONFIG_USART1_TXDMA) + .ops = &g_uart_txdma_ops, +#else + .ops = &g_uart_ops, +#endif + .priv = &g_usart1priv, + }, .irq = STM32_IRQ_USART1, .rxftcfg = CONFIG_USART1_RXFIFO_THRES, @@ -989,31 +989,31 @@ static struct up_dev_s g_usart1priv = static struct up_dev_s g_usart2priv = { .dev = - { + { #if CONSOLE_UART == 2 - .isconsole = true, + .isconsole = true, #endif - .recv = - { - .size = sizeof(g_usart2rxbuffer), - .buffer = g_usart2rxbuffer, - }, - .xmit = - { - .size = sizeof(g_usart2txbuffer), - .buffer = g_usart2txbuffer, - }, -#if defined(CONFIG_USART2_RXDMA) && defined(CONFIG_USART2_TXDMA) - .ops = &g_uart_rxtxdma_ops, -#elif defined(CONFIG_USART2_RXDMA) && !defined(CONFIG_USART2_TXDMA) - .ops = &g_uart_rxdma_ops, -#elif !defined(CONFIG_USART2_RXDMA) && defined(CONFIG_USART2_TXDMA) - .ops = &g_uart_txdma_ops, -#else - .ops = &g_uart_ops, -#endif - .priv = &g_usart2priv, + .recv = + { + .size = sizeof(g_usart2rxbuffer), + .buffer = g_usart2rxbuffer, }, + .xmit = + { + .size = sizeof(g_usart2txbuffer), + .buffer = g_usart2txbuffer, + }, +#if defined(CONFIG_USART2_RXDMA) && defined(CONFIG_USART2_TXDMA) + .ops = &g_uart_rxtxdma_ops, +#elif defined(CONFIG_USART2_RXDMA) && !defined(CONFIG_USART2_TXDMA) + .ops = &g_uart_rxdma_ops, +#elif !defined(CONFIG_USART2_RXDMA) && defined(CONFIG_USART2_TXDMA) + .ops = &g_uart_txdma_ops, +#else + .ops = &g_uart_ops, +#endif + .priv = &g_usart2priv, + }, .irq = STM32_IRQ_USART2, .rxftcfg = CONFIG_USART2_RXFIFO_THRES, @@ -1059,31 +1059,31 @@ static struct up_dev_s g_usart2priv = static struct up_dev_s g_usart3priv = { .dev = - { + { #if CONSOLE_UART == 3 - .isconsole = true, + .isconsole = true, #endif - .recv = - { - .size = sizeof(g_usart3rxbuffer), - .buffer = g_usart3rxbuffer, - }, - .xmit = - { - .size = sizeof(g_usart3txbuffer), - .buffer = g_usart3txbuffer, - }, -#if defined(CONFIG_USART3_RXDMA) && defined(CONFIG_USART3_TXDMA) - .ops = &g_uart_rxtxdma_ops, -#elif defined(CONFIG_USART3_RXDMA) && !defined(CONFIG_USART3_TXDMA) - .ops = &g_uart_rxdma_ops, -#elif !defined(CONFIG_USART3_RXDMA) && defined(CONFIG_USART3_TXDMA) - .ops = &g_uart_txdma_ops, -#else - .ops = &g_uart_ops, -#endif - .priv = &g_usart3priv, + .recv = + { + .size = sizeof(g_usart3rxbuffer), + .buffer = g_usart3rxbuffer, }, + .xmit = + { + .size = sizeof(g_usart3txbuffer), + .buffer = g_usart3txbuffer, + }, +#if defined(CONFIG_USART3_RXDMA) && defined(CONFIG_USART3_TXDMA) + .ops = &g_uart_rxtxdma_ops, +#elif defined(CONFIG_USART3_RXDMA) && !defined(CONFIG_USART3_TXDMA) + .ops = &g_uart_rxdma_ops, +#elif !defined(CONFIG_USART3_RXDMA) && defined(CONFIG_USART3_TXDMA) + .ops = &g_uart_txdma_ops, +#else + .ops = &g_uart_ops, +#endif + .priv = &g_usart3priv, + }, .irq = STM32_IRQ_USART3, .rxftcfg = CONFIG_USART3_RXFIFO_THRES, @@ -1129,31 +1129,31 @@ static struct up_dev_s g_usart3priv = static struct up_dev_s g_uart4priv = { .dev = - { + { #if CONSOLE_UART == 4 - .isconsole = true, + .isconsole = true, #endif - .recv = - { - .size = sizeof(g_uart4rxbuffer), - .buffer = g_uart4rxbuffer, - }, - .xmit = - { - .size = sizeof(g_uart4txbuffer), - .buffer = g_uart4txbuffer, - }, -#if defined(CONFIG_UART4_RXDMA) && defined(CONFIG_UART4_TXDMA) - .ops = &g_uart_rxtxdma_ops, -#elif defined(CONFIG_UART4_RXDMA) && !defined(CONFIG_UART4_TXDMA) - .ops = &g_uart_rxdma_ops, -#elif !defined(CONFIG_UART4_RXDMA) && defined(CONFIG_UART4_TXDMA) - .ops = &g_uart_txdma_ops, -#else - .ops = &g_uart_ops, -#endif - .priv = &g_uart4priv, + .recv = + { + .size = sizeof(g_uart4rxbuffer), + .buffer = g_uart4rxbuffer, }, + .xmit = + { + .size = sizeof(g_uart4txbuffer), + .buffer = g_uart4txbuffer, + }, +#if defined(CONFIG_UART4_RXDMA) && defined(CONFIG_UART4_TXDMA) + .ops = &g_uart_rxtxdma_ops, +#elif defined(CONFIG_UART4_RXDMA) && !defined(CONFIG_UART4_TXDMA) + .ops = &g_uart_rxdma_ops, +#elif !defined(CONFIG_UART4_RXDMA) && defined(CONFIG_UART4_TXDMA) + .ops = &g_uart_txdma_ops, +#else + .ops = &g_uart_ops, +#endif + .priv = &g_uart4priv, + }, .irq = STM32_IRQ_UART4, .rxftcfg = CONFIG_UART4_RXFIFO_THRES, @@ -1199,31 +1199,31 @@ static struct up_dev_s g_uart4priv = static struct up_dev_s g_uart5priv = { .dev = - { + { #if CONSOLE_UART == 5 - .isconsole = true, + .isconsole = true, #endif - .recv = - { - .size = sizeof(g_uart5rxbuffer), - .buffer = g_uart5rxbuffer, - }, - .xmit = - { - .size = sizeof(g_uart5txbuffer), - .buffer = g_uart5txbuffer, - }, -#if defined(CONFIG_UART5_RXDMA) && defined(CONFIG_UART5_TXDMA) - .ops = &g_uart_rxtxdma_ops, -#elif defined(CONFIG_UART5_RXDMA) && !defined(CONFIG_UART5_TXDMA) - .ops = &g_uart_rxdma_ops, -#elif !defined(CONFIG_UART5_RXDMA) && defined(CONFIG_UART5_TXDMA) - .ops = &g_uart_txdma_ops, -#else - .ops = &g_uart_ops, -#endif - .priv = &g_uart5priv, + .recv = + { + .size = sizeof(g_uart5rxbuffer), + .buffer = g_uart5rxbuffer, }, + .xmit = + { + .size = sizeof(g_uart5txbuffer), + .buffer = g_uart5txbuffer, + }, +#if defined(CONFIG_UART5_RXDMA) && defined(CONFIG_UART5_TXDMA) + .ops = &g_uart_rxtxdma_ops, +#elif defined(CONFIG_UART5_RXDMA) && !defined(CONFIG_UART5_TXDMA) + .ops = &g_uart_rxdma_ops, +#elif !defined(CONFIG_UART5_RXDMA) && defined(CONFIG_UART5_TXDMA) + .ops = &g_uart_txdma_ops, +#else + .ops = &g_uart_ops, +#endif + .priv = &g_uart5priv, + }, .irq = STM32_IRQ_UART5, .rxftcfg = CONFIG_UART5_RXFIFO_THRES, @@ -1269,31 +1269,31 @@ static struct up_dev_s g_uart5priv = static struct up_dev_s g_usart6priv = { .dev = - { + { #if CONSOLE_UART == 6 - .isconsole = true, + .isconsole = true, #endif - .recv = - { - .size = sizeof(g_usart6rxbuffer), - .buffer = g_usart6rxbuffer, - }, - .xmit = - { - .size = sizeof(g_usart6txbuffer), - .buffer = g_usart6txbuffer, - }, -#if defined(CONFIG_USART6_RXDMA) && defined(CONFIG_USART6_TXDMA) - .ops = &g_uart_rxtxdma_ops, -#elif defined(CONFIG_USART6_RXDMA) && !defined(CONFIG_USART6_TXDMA) - .ops = &g_uart_rxdma_ops, -#elif !defined(CONFIG_USART6_RXDMA) && defined(CONFIG_USART6_TXDMA) - .ops = &g_uart_txdma_ops, -#else - .ops = &g_uart_ops, -#endif - .priv = &g_usart6priv, + .recv = + { + .size = sizeof(g_usart6rxbuffer), + .buffer = g_usart6rxbuffer, }, + .xmit = + { + .size = sizeof(g_usart6txbuffer), + .buffer = g_usart6txbuffer, + }, +#if defined(CONFIG_USART6_RXDMA) && defined(CONFIG_USART6_TXDMA) + .ops = &g_uart_rxtxdma_ops, +#elif defined(CONFIG_USART6_RXDMA) && !defined(CONFIG_USART6_TXDMA) + .ops = &g_uart_rxdma_ops, +#elif !defined(CONFIG_USART6_RXDMA) && defined(CONFIG_USART6_TXDMA) + .ops = &g_uart_txdma_ops, +#else + .ops = &g_uart_ops, +#endif + .priv = &g_usart6priv, + }, .irq = STM32_IRQ_USART6, .rxftcfg = CONFIG_USART6_RXFIFO_THRES, @@ -1339,31 +1339,31 @@ static struct up_dev_s g_usart6priv = static struct up_dev_s g_uart7priv = { .dev = - { + { #if CONSOLE_UART == 7 - .isconsole = true, + .isconsole = true, #endif - .recv = - { - .size = sizeof(g_uart7rxbuffer), - .buffer = g_uart7rxbuffer, - }, - .xmit = - { - .size = sizeof(g_uart7txbuffer), - .buffer = g_uart7txbuffer, - }, -#if defined(CONFIG_UART7_RXDMA) && defined(CONFIG_UART7_TXDMA) - .ops = &g_uart_rxtxdma_ops, -#elif defined(CONFIG_UART7_RXDMA) && !defined(CONFIG_UART7_TXDMA) - .ops = &g_uart_rxdma_ops, -#elif !defined(CONFIG_UART7_RXDMA) && defined(CONFIG_UART7_TXDMA) - .ops = &g_uart_txdma_ops, -#else - .ops = &g_uart_ops, -#endif - .priv = &g_uart7priv, + .recv = + { + .size = sizeof(g_uart7rxbuffer), + .buffer = g_uart7rxbuffer, }, + .xmit = + { + .size = sizeof(g_uart7txbuffer), + .buffer = g_uart7txbuffer, + }, +#if defined(CONFIG_UART7_RXDMA) && defined(CONFIG_UART7_TXDMA) + .ops = &g_uart_rxtxdma_ops, +#elif defined(CONFIG_UART7_RXDMA) && !defined(CONFIG_UART7_TXDMA) + .ops = &g_uart_rxdma_ops, +#elif !defined(CONFIG_UART7_RXDMA) && defined(CONFIG_UART7_TXDMA) + .ops = &g_uart_txdma_ops, +#else + .ops = &g_uart_ops, +#endif + .priv = &g_uart7priv, + }, .irq = STM32_IRQ_UART7, .rxftcfg = CONFIG_UART7_RXFIFO_THRES, @@ -1409,31 +1409,31 @@ static struct up_dev_s g_uart7priv = static struct up_dev_s g_uart8priv = { .dev = - { + { #if CONSOLE_UART == 8 - .isconsole = true, + .isconsole = true, #endif - .recv = - { - .size = sizeof(g_uart8rxbuffer), - .buffer = g_uart8rxbuffer, - }, - .xmit = - { - .size = sizeof(g_uart8txbuffer), - .buffer = g_uart8txbuffer, - }, -#if defined(CONFIG_UART8_RXDMA) && defined(CONFIG_UART8_TXDMA) - .ops = &g_uart_rxtxdma_ops, -#elif defined(CONFIG_UART8_RXDMA) && !defined(CONFIG_UART8_TXDMA) - .ops = &g_uart_rxdma_ops, -#elif !defined(CONFIG_UART8_RXDMA) && defined(CONFIG_UART8_TXDMA) - .ops = &g_uart_txdma_ops, -#else - .ops = &g_uart_ops, -#endif - .priv = &g_uart8priv, + .recv = + { + .size = sizeof(g_uart8rxbuffer), + .buffer = g_uart8rxbuffer, }, + .xmit = + { + .size = sizeof(g_uart8txbuffer), + .buffer = g_uart8txbuffer, + }, +#if defined(CONFIG_UART8_RXDMA) && defined(CONFIG_UART8_TXDMA) + .ops = &g_uart_rxtxdma_ops, +#elif defined(CONFIG_UART8_RXDMA) && !defined(CONFIG_UART8_TXDMA) + .ops = &g_uart_rxdma_ops, +#elif !defined(CONFIG_UART8_RXDMA) && defined(CONFIG_UART8_TXDMA) + .ops = &g_uart_txdma_ops, +#else + .ops = &g_uart_ops, +#endif + .priv = &g_uart8priv, + }, .irq = STM32_IRQ_UART8, .rxftcfg = CONFIG_UART8_RXFIFO_THRES, @@ -2274,7 +2274,7 @@ static int up_dma_setup(struct uart_dev_s *dev) * worth of time to claim bytes before they are overwritten. */ - stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, true); + stm32_dmastart(priv->rxdma, up_dma_rxcallback, priv, true); } #endif @@ -3253,7 +3253,7 @@ static void up_dma_reenable(struct up_dev_s *priv) * worth of time to claim bytes before they are overwritten. */ - stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, true); + stm32_dmastart(priv->rxdma, up_dma_rxcallback, priv, true); /* Clear DMA suspended flag. */ @@ -3352,7 +3352,7 @@ static void up_dma_txcallback(DMA_HANDLE handle, uint8_t status, void *arg) /* Start transmission with the callback on DMA completion */ stm32_dmastart(priv->txdma, up_dma_txcallback, - (void *)priv, false); + priv, false); return; } @@ -3438,7 +3438,7 @@ static void up_dma_send(struct uart_dev_s *dev) /* Start transmission with the callback on DMA completion */ - stm32_dmastart(priv->txdma, up_dma_txcallback, (void *)priv, false); + stm32_dmastart(priv->txdma, up_dma_txcallback, priv, false); } #endif @@ -3481,7 +3481,7 @@ static void up_dma_txint(struct uart_dev_s *dev, bool enable) * Instead, we use DMA interrupts that are activated once during boot * sequence. Furthermore we can use up_dma_txcallback() to handle staff at * half DMA transfer or after transfer completion (depending configuration, - * see stm32_dmastart(...) ). + * see stm32_dmastart(...)). */ } #endif diff --git a/arch/arm/src/stm32h7/stm32_spi.c b/arch/arm/src/stm32h7/stm32_spi.c index 59d0ef5fce..d128f884a9 100644 --- a/arch/arm/src/stm32h7/stm32_spi.c +++ b/arch/arm/src/stm32h7/stm32_spi.c @@ -395,9 +395,9 @@ static uint8_t g_spi1_rxbuf[SPI1_DMABUFSIZE_ADJUSTED] SPI1_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi1dev = { .spidev = - { - &g_sp1iops - }, + { + .ops = &g_sp1iops, + }, .spibase = STM32_SPI1_BASE, .spiclock = SPI123_KERNEL_CLOCK_FREQ, .spiirq = STM32_IRQ_SPI1, @@ -467,9 +467,9 @@ static uint8_t g_spi2_rxbuf[SPI2_DMABUFSIZE_ADJUSTED] SPI2_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi2dev = { .spidev = - { - &g_sp2iops - }, + { + .ops = &g_sp2iops, + }, .spibase = STM32_SPI2_BASE, .spiclock = SPI123_KERNEL_CLOCK_FREQ, .spiirq = STM32_IRQ_SPI2, @@ -539,9 +539,9 @@ static uint8_t g_spi3_rxbuf[SPI3_DMABUFSIZE_ADJUSTED] SPI3_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi3dev = { .spidev = - { - &g_sp3iops - }, + { + .ops = &g_sp3iops, + }, .spibase = STM32_SPI3_BASE, .spiclock = SPI123_KERNEL_CLOCK_FREQ, .spiirq = STM32_IRQ_SPI3, @@ -611,9 +611,9 @@ static uint8_t g_spi4_rxbuf[SPI4_DMABUFSIZE_ADJUSTED] SPI4_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi4dev = { .spidev = - { - &g_sp4iops - }, + { + .ops = &g_sp4iops, + }, .spibase = STM32_SPI4_BASE, .spiclock = SPI45_KERNEL_CLOCK_FREQ, .spiirq = STM32_IRQ_SPI4, @@ -683,9 +683,9 @@ static uint8_t g_spi5_rxbuf[SPI5_DMABUFSIZE_ADJUSTED] SPI5_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi5dev = { .spidev = - { - &g_sp5iops - }, + { + .ops = &g_sp5iops, + }, .spibase = STM32_SPI5_BASE, .spiclock = SPI45_KERNEL_CLOCK_FREQ, .spiirq = STM32_IRQ_SPI5, @@ -756,20 +756,20 @@ static uint8_t g_spi6_rxbuf[SPI6_DMABUFSIZE_ADJUSTED] SPI6_DMABUFSIZE_ALGN static struct stm32_spidev_s g_spi6dev = { .spidev = - { - &g_sp6iops - }, + { + .ops = &g_sp6iops, + }, .spibase = STM32_SPI6_BASE, .spiclock = SPI6_KERNEL_CLOCK_FREQ, .spiirq = STM32_IRQ_SPI6, #ifdef CONFIG_STM32H7_SPI6_DMA .rxch = DMAMAP_SPI6_RX, .txch = DMAMAP_SPI6_TX, -#if defined(SPI6_DMABUFSIZE_ADJUSTED) +# if defined(SPI6_DMABUFSIZE_ADJUSTED) .rxbuf = g_spi6_rxbuf, .txbuf = g_spi6_txbuf, .buflen = SPI6_DMABUFSIZE_ADJUSTED, -# endif +# endif .rxsem = SEM_INITIALIZER(0), .txsem = SEM_INITIALIZER(0), #endif @@ -2053,7 +2053,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, static uint8_t rxdummy[ARMV7M_DCACHE_LINESIZE] aligned_data(ARMV7M_DCACHE_LINESIZE); static const uint16_t txdummy = 0xffff; - void * orig_rxbuffer = rxbuffer; + void *orig_rxbuffer = rxbuffer; DEBUGASSERT(priv != NULL); diff --git a/arch/arm/src/stm32l4/stm32l4_1wire.c b/arch/arm/src/stm32l4/stm32l4_1wire.c index 8141da6643..593eb86478 100644 --- a/arch/arm/src/stm32l4/stm32l4_1wire.c +++ b/arch/arm/src/stm32l4/stm32l4_1wire.c @@ -125,8 +125,8 @@ struct stm32_1wire_priv_s struct stm32_1wire_inst_s { - const struct onewire_ops_s *ops; /* Standard 1-Wire operations */ - struct stm32_1wire_priv_s *priv; /* Common driver private data structure */ + const struct onewire_ops_s *ops; /* Standard 1-Wire operations */ + struct stm32_1wire_priv_s *priv; /* Common driver private data structure */ }; /**************************************************************************** diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 1b3cc85fec..ad188df8b0 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -2704,7 +2704,7 @@ static int stm32l4_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int stm32l4_i2c_reset(struct i2c_master_s * dev) +static int stm32l4_i2c_reset(struct i2c_master_s *dev) { struct stm32l4_i2c_priv_s *priv; unsigned int clock_count; diff --git a/arch/arm/src/stm32l4/stm32l4_otgfshost.c b/arch/arm/src/stm32l4/stm32l4_otgfshost.c index 6fc6a8b598..b382de3307 100644 --- a/arch/arm/src/stm32l4/stm32l4_otgfshost.c +++ b/arch/arm/src/stm32l4/stm32l4_otgfshost.c @@ -493,8 +493,8 @@ static struct stm32l4_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = stm32l4_wait, - .enumerate = stm32l4_enumerate, + .wait = stm32l4_wait, + .enumerate = stm32l4_enumerate, }; /**************************************************************************** @@ -5285,7 +5285,7 @@ static inline void stm32l4_sw_initialize(struct stm32l4_usbhost_s *priv) struct stm32l4_chan_s *chan = &priv->chan[i]; chan->chidx = i; - nxsem_init(&chan->waitsem, 0, 0); + nxsem_init(&chan->waitsem, 0, 0); } } diff --git a/arch/arm/src/stm32l4/stm32l4_qspi.c b/arch/arm/src/stm32l4/stm32l4_qspi.c index 606dbfb172..05c3b8bd8c 100644 --- a/arch/arm/src/stm32l4/stm32l4_qspi.c +++ b/arch/arm/src/stm32l4/stm32l4_qspi.c @@ -333,7 +333,7 @@ static const struct qspi_ops_s g_qspi0ops = static struct stm32l4_qspidev_s g_qspi0dev = { - .qspi = + .qspi = { .ops = &g_qspi0ops, }, diff --git a/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c b/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c index 2e2d18281f..b2836ec2fb 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c +++ b/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c @@ -154,7 +154,7 @@ static const struct rtc_ops_s g_rtc_ops = static struct stm32l4_lowerhalf_s g_rtc_lowerhalf = { - .ops = &g_rtc_ops, + .ops = &g_rtc_ops, .devlock = NXMUTEX_INITIALIZER, }; diff --git a/arch/arm/src/stm32l4/stm32l4_spi.c b/arch/arm/src/stm32l4/stm32l4_spi.c index d5b0810ec6..fd7d1e748f 100644 --- a/arch/arm/src/stm32l4/stm32l4_spi.c +++ b/arch/arm/src/stm32l4/stm32l4_spi.c @@ -280,9 +280,9 @@ static const struct spi_ops_s g_spi1ops = static struct stm32l4_spidev_s g_spi1dev = { .spidev = - { - &g_spi1ops - }, + { + .ops = &g_spi1ops, + }, .spibase = STM32L4_SPI1_BASE, .spiclock = STM32L4_PCLK2_FREQUENCY, #ifdef CONFIG_STM32L4_SPI_INTERRUPTS @@ -338,9 +338,9 @@ static const struct spi_ops_s g_spi2ops = static struct stm32l4_spidev_s g_spi2dev = { .spidev = - { - &g_spi2ops - }, + { + .ops = &g_spi2ops, + }, .spibase = STM32L4_SPI2_BASE, .spiclock = STM32L4_PCLK1_FREQUENCY, #ifdef CONFIG_STM32L4_SPI_INTERRUPTS @@ -394,9 +394,9 @@ static const struct spi_ops_s g_spi3ops = static struct stm32l4_spidev_s g_spi3dev = { .spidev = - { - &g_spi3ops - }, + { + .ops = &g_spi3ops, + }, .spibase = STM32L4_SPI3_BASE, .spiclock = STM32L4_PCLK1_FREQUENCY, #ifdef CONFIG_STM32L4_SPI_INTERRUPTS diff --git a/arch/arm/src/stm32l5/stm32l5_spi.c b/arch/arm/src/stm32l5/stm32l5_spi.c index 0a01960ffb..07b9645a89 100644 --- a/arch/arm/src/stm32l5/stm32l5_spi.c +++ b/arch/arm/src/stm32l5/stm32l5_spi.c @@ -280,9 +280,9 @@ static const struct spi_ops_s g_spi1ops = static struct stm32l5_spidev_s g_spi1dev = { .spidev = - { - &g_spi1ops - }, + { + .ops = &g_spi1ops, + }, .spibase = STM32L5_SPI1_BASE, .spiclock = STM32L5_PCLK2_FREQUENCY, #ifdef CONFIG_STM32L5_SPI_INTERRUPTS @@ -338,9 +338,9 @@ static const struct spi_ops_s g_spi2ops = static struct stm32l5_spidev_s g_spi2dev = { .spidev = - { - &g_spi2ops - }, + { + .ops = &g_spi2ops, + }, .spibase = STM32L5_SPI2_BASE, .spiclock = STM32L5_PCLK1_FREQUENCY, #ifdef CONFIG_STM32L5_SPI_INTERRUPTS @@ -394,9 +394,9 @@ static const struct spi_ops_s g_spi3ops = static struct stm32l5_spidev_s g_spi3dev = { .spidev = - { - &g_spi3ops - }, + { + .ops = &g_spi3ops, + }, .spibase = STM32L5_SPI3_BASE, .spiclock = STM32L5_PCLK1_FREQUENCY, #ifdef CONFIG_STM32L5_SPI_INTERRUPTS diff --git a/arch/arm/src/stm32u5/stm32_spi.c b/arch/arm/src/stm32u5/stm32_spi.c index 9ca4003b5d..6b052f3ecc 100644 --- a/arch/arm/src/stm32u5/stm32_spi.c +++ b/arch/arm/src/stm32u5/stm32_spi.c @@ -347,9 +347,9 @@ static uint8_t g_spi1_rxbuf[SPI1_DMABUFSIZE_ADJUSTED] SPI1_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi1dev = { .spidev = - { - &g_sp1iops - }, + { + .ops = &g_sp1iops, + }, .spibase = STM32_SPI1_BASE, .spiclock = SPI1_KERNEL_CLOCK_FREQ, .spiirq = STM32_IRQ_SPI1, @@ -419,9 +419,9 @@ static uint8_t g_spi2_rxbuf[SPI2_DMABUFSIZE_ADJUSTED] SPI2_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi2dev = { .spidev = - { - &g_sp2iops - }, + { + .ops = &g_sp2iops, + }, .spibase = STM32_SPI2_BASE, .spiclock = SPI2_KERNEL_CLOCK_FREQ, .spiirq = STM32_IRQ_SPI2, @@ -491,9 +491,9 @@ static uint8_t g_spi3_rxbuf[SPI3_DMABUFSIZE_ADJUSTED] SPI3_DMABUFSIZE_ALGN; static struct stm32_spidev_s g_spi3dev = { .spidev = - { - &g_sp3iops - }, + { + .ops = &g_sp3iops, + }, .spibase = STM32_SPI3_BASE, .spiclock = SPI3_KERNEL_CLOCK_FREQ, .spiirq = STM32_IRQ_SPI3, @@ -1786,7 +1786,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, static uint8_t rxdummy[ARMV7M_DCACHE_LINESIZE] aligned_data(ARMV7M_DCACHE_LINESIZE); static const uint16_t txdummy = 0xffff; - void * orig_rxbuffer = rxbuffer; + void *orig_rxbuffer = rxbuffer; DEBUGASSERT(priv != NULL); diff --git a/arch/arm/src/stm32wb/stm32wb_rtc_lowerhalf.c b/arch/arm/src/stm32wb/stm32wb_rtc_lowerhalf.c index 4bf9f2ceec..5b8871d851 100644 --- a/arch/arm/src/stm32wb/stm32wb_rtc_lowerhalf.c +++ b/arch/arm/src/stm32wb/stm32wb_rtc_lowerhalf.c @@ -153,7 +153,7 @@ static const struct rtc_ops_s g_rtc_ops = static struct stm32wb_lowerhalf_s g_rtc_lowerhalf = { - .ops = &g_rtc_ops, + .ops = &g_rtc_ops, .devlock = NXMUTEX_INITIALIZER, }; diff --git a/arch/arm/src/stm32wb/stm32wb_spi.c b/arch/arm/src/stm32wb/stm32wb_spi.c index f99da36da7..e1aff781d6 100644 --- a/arch/arm/src/stm32wb/stm32wb_spi.c +++ b/arch/arm/src/stm32wb/stm32wb_spi.c @@ -276,9 +276,9 @@ static const struct spi_ops_s g_spi1ops = static struct stm32wb_spidev_s g_spi1dev = { .spidev = - { - &g_spi1ops - }, + { + .ops = &g_spi1ops, + }, .spibase = STM32WB_SPI1_BASE, .spiclock = STM32WB_PCLK2_FREQUENCY, #ifdef CONFIG_STM32WB_SPI_INTERRUPTS @@ -334,9 +334,9 @@ static const struct spi_ops_s g_spi2ops = static struct stm32wb_spidev_s g_spi2dev = { .spidev = - { - &g_spi2ops - }, + { + .ops = &g_spi2ops, + }, .spibase = STM32WB_SPI2_BASE, .spiclock = STM32WB_PCLK1_FREQUENCY, #ifdef CONFIG_STM32WB_SPI_INTERRUPTS diff --git a/arch/arm/src/stm32wl5/stm32wl5_spi.c b/arch/arm/src/stm32wl5/stm32wl5_spi.c index 30e1e6c112..e8c438b967 100644 --- a/arch/arm/src/stm32wl5/stm32wl5_spi.c +++ b/arch/arm/src/stm32wl5/stm32wl5_spi.c @@ -311,9 +311,9 @@ static uint8_t g_spi1_rxbuf[SPI1_DMABUFSIZE_ADJUSTED] SPI1_DMABUFSIZE_ALGN; static struct stm32wl5_spidev_s g_spi1dev = { .spidev = - { - &g_sp1iops - }, + { + .ops = &g_sp1iops, + }, .spibase = STM32WL5_SPI1_BASE, .spiclock = STM32WL5_PCLK2_FREQUENCY, #ifdef CONFIG_STM32WL5_SPI_INTERRUPTS diff --git a/arch/arm/src/tiva/common/tiva_can.c b/arch/arm/src/tiva/common/tiva_can.c index f498a21582..15b6b9096b 100644 --- a/arch/arm/src/tiva/common/tiva_can.c +++ b/arch/arm/src/tiva/common/tiva_can.c @@ -248,7 +248,7 @@ static int tivacan_rxhandler(int argc, char** argv); int tivacan_handle_errors(struct can_dev_s *dev); #ifdef CONFIG_CAN_ERRORS -void tivacan_handle_errors_wqueue(void * dev); +void tivacan_handle_errors_wqueue(void *dev); #endif /**************************************************************************** @@ -393,11 +393,11 @@ static void tivacan_reset(struct can_dev_s *dev) static int tivacan_setup(struct can_dev_s *dev) { - uint32_t irq; - int ret; - uint32_t reg; - struct tiva_canmod_s *canmod = dev->cd_priv; - char *kthd_argv[2]; + uint32_t irq; + int ret; + uint32_t reg; + struct tiva_canmod_s *canmod = dev->cd_priv; + char *kthd_argv[2]; kthd_argv[1] = NULL; switch (canmod->modnum) @@ -1379,7 +1379,7 @@ static bool tivacan_txempty(struct can_dev_s *dev) ****************************************************************************/ #ifdef CONFIG_CAN_ERRORS -void tivacan_handle_errors_wqueue(void * dev) +void tivacan_handle_errors_wqueue(void *dev) { irqstate_t flags; struct tiva_canmod_s *canmod = ((struct can_dev_s *)dev)->cd_priv; @@ -2042,7 +2042,7 @@ int tivacan_alloc_fifo(struct can_dev_s *dev, int depth) static void tivacan_free_fifo(struct can_dev_s *dev, tiva_can_fifo_t *fifo) { - struct tiva_canmod_s * canmod = dev->cd_priv; + struct tiva_canmod_s *canmod = dev->cd_priv; nxmutex_lock(&canmod->thd_iface_lock); for (int i = 0; i < TIVA_CAN_NUM_MBOXES; ++i) diff --git a/arch/arm/src/tiva/common/tiva_hciuart.c b/arch/arm/src/tiva/common/tiva_hciuart.c index 3e203ed169..e32ae9cad4 100644 --- a/arch/arm/src/tiva/common/tiva_hciuart.c +++ b/arch/arm/src/tiva/common/tiva_hciuart.c @@ -193,14 +193,14 @@ static struct hciuart_state_s g_hciuart0_state = static const struct hciuart_config_s g_hciuart0_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart0_state, @@ -243,14 +243,14 @@ static struct hciuart_state_s g_hciuart1_state = static const struct hciuart_config_s g_hciuart1_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart1_state, @@ -293,14 +293,14 @@ static struct hciuart_state_s g_hciuart2_state = static const struct hciuart_config_s g_hciuart2_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart2_state, @@ -343,14 +343,14 @@ static struct hciuart_state_s g_hciuart3_state = static const struct hciuart_config_s g_hciuart3_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart3_state, @@ -393,14 +393,14 @@ static struct hciuart_state_s g_hciuart4_state; static const struct hciuart_config_s g_hciuart4_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart4_state, @@ -443,14 +443,14 @@ static struct hciuart_state_s g_hciuart5_state = static const struct hciuart_config_s g_hciuart5_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart5_state, @@ -493,14 +493,14 @@ static struct hciuart_state_s g_hciuart6_state = static const struct hciuart_config_s g_hciuart6_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart6_state, @@ -543,14 +543,14 @@ static struct hciuart_state_s g_hciuart7_state = static const struct hciuart_config_s g_hciuart7_config = { .lower = - { - .rxattach = hciuart_rxattach, - .rxenable = hciuart_rxenable, - .setbaud = hciuart_setbaud, - .read = hciuart_read, - .write = hciuart_write, - .rxdrain = hciuart_rxdrain, - }, + { + .rxattach = hciuart_rxattach, + .rxenable = hciuart_rxenable, + .setbaud = hciuart_setbaud, + .read = hciuart_read, + .write = hciuart_write, + .rxdrain = hciuart_rxdrain, + }, .state = &g_hciuart7_state, diff --git a/arch/arm/src/tiva/common/tiva_i2c.c b/arch/arm/src/tiva/common/tiva_i2c.c index f607b94139..e1bd58b5f2 100644 --- a/arch/arm/src/tiva/common/tiva_i2c.c +++ b/arch/arm/src/tiva/common/tiva_i2c.c @@ -1743,7 +1743,7 @@ static int tiva_i2c_transfer(struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int tiva_i2c_reset(struct i2c_master_s * dev) +static int tiva_i2c_reset(struct i2c_master_s *dev) { struct tiva_i2c_priv_s *priv = (struct tiva_i2c_priv_s *)dev; unsigned int clock_count; diff --git a/arch/arm/src/tiva/common/tiva_ssi.c b/arch/arm/src/tiva/common/tiva_ssi.c index 8464d335a9..8168bbd5e6 100644 --- a/arch/arm/src/tiva/common/tiva_ssi.c +++ b/arch/arm/src/tiva/common/tiva_ssi.c @@ -323,45 +323,45 @@ static struct tiva_ssidev_s g_ssidev[] = #endif #ifdef CONFIG_TIVA_SSI1 { - .ops = &g_spiops, + .ops = &g_spiops, #if NSSI_ENABLED > 1 - .base = TIVA_SSI1_BASE, + .base = TIVA_SSI1_BASE, #endif #ifndef CONFIG_SSI_POLLWAIT .xfrsem = SEM_INITIALIZER(0), #endif #if !defined(CONFIG_SSI_POLLWAIT) && NSSI_ENABLED > 1 - .irq = TIVA_IRQ_SSI1, + .irq = TIVA_IRQ_SSI1, #endif .lock = NXMUTEX_INITIALIZER, }, #endif #ifdef CONFIG_TIVA_SSI2 { - .ops = &g_spiops, + .ops = &g_spiops, #if NSSI_ENABLED > 1 - .base = TIVA_SSI2_BASE, + .base = TIVA_SSI2_BASE, #endif #ifndef CONFIG_SSI_POLLWAIT .xfrsem = SEM_INITIALIZER(0), #endif #if !defined(CONFIG_SSI_POLLWAIT) && NSSI_ENABLED > 1 - .irq = TIVA_IRQ_SSI2, + .irq = TIVA_IRQ_SSI2, #endif .lock = NXMUTEX_INITIALIZER, }, #endif #ifdef CONFIG_TIVA_SSI3 { - .ops = &g_spiops, + .ops = &g_spiops, #if NSSI_ENABLED > 1 - .base = TIVA_SSI3_BASE, + .base = TIVA_SSI3_BASE, #endif #ifndef CONFIG_SSI_POLLWAIT .xfrsem = SEM_INITIALIZER(0), #endif #if !defined(CONFIG_SSI_POLLWAIT) && NSSI_ENABLED > 1 - .irq = TIVA_IRQ_SSI3, + .irq = TIVA_IRQ_SSI3, #endif .lock = NXMUTEX_INITIALIZER, }, diff --git a/arch/arm/src/tlsr82/tlsr82_serial.c b/arch/arm/src/tlsr82/tlsr82_serial.c index c38e3b9088..2aa0d99347 100644 --- a/arch/arm/src/tlsr82/tlsr82_serial.c +++ b/arch/arm/src/tlsr82/tlsr82_serial.c @@ -1083,7 +1083,7 @@ static int UART_RAMCODE tlsr82_interrupt(int irq, void *context, void *arg) UNUSED(context); struct uart_dev_s *dev = (struct uart_dev_s *)arg; - uart_priv_t * priv = (uart_priv_t *)dev->priv; + uart_priv_t *priv = (uart_priv_t *)dev->priv; if ((UART_BUF_CNT1_REG & UART_BUF_CNT1_RX_ERR)) { @@ -1163,7 +1163,7 @@ static int UART_RAMCODE tlsr82_dma_interrupt(int irq, void *context, void *arg) { struct uart_dev_s *dev = (struct uart_dev_s *)arg; - uart_priv_t * priv = (uart_priv_t *)dev->priv; + uart_priv_t *priv = (uart_priv_t *)dev->priv; /* Check the uart dma rx interrupt status */ @@ -1503,7 +1503,7 @@ static void tlsr82_uart_dma_txint(struct uart_dev_s *dev, bool enable) * Instead, we use DMA interrupts that are activated once during boot * sequence. Furthermore we can use up_dma_txcallback() to handle staff at * half DMA transfer or after transfer completion (depending configuration, - * see stm32_dmastart(...) ). + * see stm32_dmastart(...)). */ } #endif diff --git a/arch/arm/src/xmc4/xmc4_spi.c b/arch/arm/src/xmc4/xmc4_spi.c index 3396a05beb..7c24edac97 100644 --- a/arch/arm/src/xmc4/xmc4_spi.c +++ b/arch/arm/src/xmc4/xmc4_spi.c @@ -1085,8 +1085,8 @@ static int spi_lock(struct spi_dev_s *dev, bool lock) static void spi_select(struct spi_dev_s *dev, uint32_t devid, bool selected) { - struct xmc4_spics_s *spics = (struct xmc4_spics_s *)dev; - struct xmc4_spidev_s *spi = spi_device(spics); + struct xmc4_spics_s *spics = (struct xmc4_spics_s *)dev; + struct xmc4_spidev_s *spi = spi_device(spics); /* Are we selecting or de-selecting the device? */ diff --git a/arch/avr/src/avr/up_spi.c b/arch/avr/src/avr/up_spi.c index 38166b61cb..55b50b4c59 100644 --- a/arch/avr/src/avr/up_spi.c +++ b/arch/avr/src/avr/up_spi.c @@ -105,9 +105,9 @@ static const struct spi_ops_s g_spiops = static struct avr_spidev_s g_spidev = { .spidev = - { - &g_spiops - }, + { + .ops = &g_spiops, + }, .lock = NXMUTEX_INITIALIZER, }; diff --git a/arch/mips/src/pic32mx/pic32mx_spi.c b/arch/mips/src/pic32mx/pic32mx_spi.c index d22b823a06..3f2ad0bc96 100644 --- a/arch/mips/src/pic32mx/pic32mx_spi.c +++ b/arch/mips/src/pic32mx/pic32mx_spi.c @@ -138,7 +138,7 @@ static struct pic32mx_dev_s g_spi1dev = { .spidev = { - &g_spi1ops + .ops = &g_spi1ops, }, .base = PIC32MX_SPI1_K1BASE, #ifdef CONFIG_PIC32MX_SPI_INTERRUPTS @@ -177,7 +177,7 @@ static struct pic32mx_dev_s g_spi2dev = { .spidev = { - &g_spi2ops + .ops = &g_spi2ops, }, .base = PIC32MX_SPI2_K1BASE, #ifdef CONFIG_PIC32MX_SPI_INTERRUPTS @@ -216,7 +216,7 @@ static struct pic32mx_dev_s g_spi3dev = { .spidev = { - &g_spi3ops + .ops = &g_spi3ops, }, .base = PIC32MX_SPI3_K1BASE, #ifdef CONFIG_PIC32MX_SPI_INTERRUPTS @@ -255,7 +255,7 @@ static struct pic32mx_dev_s g_spi4dev = { .spidev = { - &g_spi4ops + .ops = &g_spi4ops, }, .base = PIC32MX_SPI4_K1BASE, #ifdef CONFIG_PIC32MX_SPI_INTERRUPTS diff --git a/arch/mips/src/pic32mz/pic32mz_spi.c b/arch/mips/src/pic32mz/pic32mz_spi.c index a9aad4ad1b..1b12e02177 100644 --- a/arch/mips/src/pic32mz/pic32mz_spi.c +++ b/arch/mips/src/pic32mz/pic32mz_spi.c @@ -281,7 +281,7 @@ static struct pic32mz_dev_s g_spi1dev = { .spidev = { - &g_spi1ops + .ops = &g_spi1ops, }, .config = &g_spi1config, .lock = NXMUTEX_INITIALIZER, @@ -334,7 +334,7 @@ static struct pic32mz_dev_s g_spi2dev = { .spidev = { - &g_spi2ops + .ops = &g_spi2ops, }, .config = &g_spi2config, .lock = NXMUTEX_INITIALIZER, @@ -387,7 +387,7 @@ static struct pic32mz_dev_s g_spi3dev = { .spidev = { - &g_spi3ops + .ops = &g_spi3ops, }, .config = &g_spi3config, .lock = NXMUTEX_INITIALIZER, @@ -440,7 +440,7 @@ static struct pic32mz_dev_s g_spi4dev = { .spidev = { - &g_spi4ops + .ops = &g_spi4ops, }, .config = &g_spi4config, .lock = NXMUTEX_INITIALIZER, @@ -493,7 +493,7 @@ static struct pic32mz_dev_s g_spi5dev = { .spidev = { - &g_spi5ops + .ops = &g_spi5ops, }, .config = &g_spi5config, .lock = NXMUTEX_INITIALIZER, @@ -546,7 +546,7 @@ static struct pic32mz_dev_s g_spi6dev = { .spidev = { - &g_spi6ops + .ops = &g_spi6ops, }, .config = &g_spi6config, .lock = NXMUTEX_INITIALIZER, @@ -1752,7 +1752,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, priv->result = -EBUSY; - ret = pic32mz_dma_start(priv->rxdma, spi_dmarxcallback, (void *)priv); + ret = pic32mz_dma_start(priv->rxdma, spi_dmarxcallback, priv); if (ret < 0) { spierr("ERROR: RX DMA start failed: %d\n", ret); @@ -1761,7 +1761,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, spi_rxdma_sample(priv, DMA_AFTER_START); - ret = pic32mz_dma_start(priv->txdma, spi_dmatxcallback, (void *)priv); + ret = pic32mz_dma_start(priv->txdma, spi_dmatxcallback, priv); if (ret < 0) { spierr("ERROR: TX DMA start failed: %d\n", ret); diff --git a/arch/renesas/src/rx65n/rx65n_riic.c b/arch/renesas/src/rx65n/rx65n_riic.c index 0133167a0a..c7a6f57d1b 100644 --- a/arch/renesas/src/rx65n/rx65n_riic.c +++ b/arch/renesas/src/rx65n/rx65n_riic.c @@ -1941,17 +1941,17 @@ static uint8_t rx65n_riic_read_data(FAR struct rx65n_i2c_priv_s *priv) if (0 == priv->bus) { - regval = (uint8_t *) (RX65N_RIIC0_ICDRR); + regval = (uint8_t *)(RX65N_RIIC0_ICDRR); } else if (1 == priv->bus) { - regval = (uint8_t *) (RX65N_RIIC1_ICDRR); + regval = (uint8_t *)(RX65N_RIIC1_ICDRR); } else { - regval = (uint8_t *) (RX65N_RIIC2_ICDRR); + regval = (uint8_t *)(RX65N_RIIC2_ICDRR); } return *regval; diff --git a/arch/renesas/src/rx65n/rx65n_rspi.c b/arch/renesas/src/rx65n/rx65n_rspi.c index 8d5bc96bdd..c625ef075f 100644 --- a/arch/renesas/src/rx65n/rx65n_rspi.c +++ b/arch/renesas/src/rx65n/rx65n_rspi.c @@ -135,7 +135,7 @@ struct rx65n_rspidev_s sem_t waitsem; /* Wait for transfer to complete */ #endif -#ifdef CONFIG_RX65N_RSPI_SW_DT_MODE +#ifdef CONFIG_RX65N_RSPI_SW_DT_MODE /* These following are the source and destination buffers of the transfer. * they are retained in this structure so that they will be accessible * from an interrupt handler. The actual type of the buffer is uint8_t is @@ -212,7 +212,7 @@ static void rspi_performtx(struct rx65n_rspidev_s *priv); static inline void rspi_performrx(struct rx65n_rspidev_s *priv); #endif static int rspi_transfer(struct rx65n_rspidev_s *priv, const void *txbuffer, - void *rxbuffer, unsigned int nwords); + void *rxbuffer, unsigned int nwords); /* Interrupt handling */ @@ -233,21 +233,21 @@ static void rspi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode); static void rspi_setbits(FAR struct spi_dev_s *dev, int nbits); #ifdef CONFIG_SPI_HWFEATURES static int rspi_hwfeatures(FAR struct spi_dev_s *dev, - spi_hwfeatures_t features); + spi_hwfeatures_t features); #endif static uint32_t rspi_send(FAR struct spi_dev_s *dev, uint32_t wd); static void rspi_exchange(FAR struct spi_dev_s *dev, - FAR const void *txbuffer, - FAR void *rxbuffer, size_t nwords); + FAR const void *txbuffer, + FAR void *rxbuffer, size_t nwords); #ifdef CONFIG_SPI_TRIGGER static int rspi_trigger(FAR struct spi_dev_s *dev); #endif #ifndef CONFIG_SPI_EXCHANGE static void rspi_sndblock(FAR struct spi_dev_s *dev, - FAR const void *txbuffer, - size_t nwords); + FAR const void *txbuffer, + size_t nwords); static void rspi_recvblock(FAR struct spi_dev_s *dev, FAR void *rxbuffer, - size_t nwords); + size_t nwords); #endif /* Initialization */ @@ -294,10 +294,10 @@ static const struct spi_ops_s g_rspi0ops = static struct rx65n_rspidev_s g_rspi0dev = { - .rspidev = - { - &g_rspi0ops - }, + .rspidev = + { + .ops = &g_rspi0ops, + }, .rspibase = RX65N_RSPI0_BASE, .rspiclock = RX65N_PCLK_FREQUENCY, #ifndef CONFIG_SPI_POLLWAIT @@ -360,10 +360,10 @@ static const struct spi_ops_s g_rspi1ops = static struct rx65n_rspidev_s g_rspi1dev = { - .rspidev = - { - &g_rspi1ops - }, + .rspidev = + { + .ops = &g_rspi1ops, + }, .rspibase = RX65N_RSPI1_BASE, .rspiclock = RX65N_PCLK_FREQUENCY, #ifndef CONFIG_SPI_POLLWAIT @@ -426,10 +426,10 @@ static const struct spi_ops_s g_rspi2ops = static struct rx65n_rspidev_s g_rspi2dev = { - .rspidev = - { - &g_rspi2ops - }, + .rspidev = + { + .ops = &g_rspi2ops, + }, .rspibase = RX65N_RSPI2_BASE, .rspiclock = RX65N_PCLK_FREQUENCY, #ifndef CONFIG_SPI_POLLWAIT @@ -627,7 +627,7 @@ int rx65n_rspi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) #ifdef CONFIG_RX65N_RSPI0 int rx65n_rspi0register(FAR struct spi_dev_s *dev, spi_mediachange_t callback, - FAR void *arg) + FAR void *arg) { spiinfo("INFO: Registering rspi0 device\n"); return OK; @@ -637,7 +637,7 @@ int rx65n_rspi0register(FAR struct spi_dev_s *dev, #ifdef CONFIG_RX65N_RSPI1 int rx65n_rspi1register(FAR struct spi_dev_s *dev, spi_mediachange_t callback, - FAR void *arg) + FAR void *arg) { spiinfo("INFO: Registering rspi1 device\n"); return OK; @@ -646,8 +646,8 @@ int rx65n_rspi1register(FAR struct spi_dev_s *dev, #ifdef CONFIG_RX65N_RSPI2 int rx65n_rspi2register(FAR struct spi_dev_s *dev, - spi_mediachange_t callback, - FAR void *arg) + spi_mediachange_t callback, + FAR void *arg) { spiinfo("INFO: Registering rspi2 device\n"); return OK; @@ -739,7 +739,7 @@ static inline uint8_t rspi_getreg8(struct rx65n_rspidev_s *priv, ****************************************************************************/ static inline void rspi_putreg32(struct rx65n_rspidev_s *priv, - uint8_t offset, uint32_t value) + uint8_t offset, uint32_t value) { putreg32(value, priv->rspibase + offset); } @@ -761,7 +761,7 @@ static inline void rspi_putreg32(struct rx65n_rspidev_s *priv, ****************************************************************************/ static inline void rspi_putreg16(struct rx65n_rspidev_s *priv, - uint8_t offset, uint16_t value) + uint8_t offset, uint16_t value) { putreg16(value, priv->rspibase + offset); } @@ -783,7 +783,7 @@ static inline void rspi_putreg16(struct rx65n_rspidev_s *priv, ****************************************************************************/ static inline void rspi_putreg8(struct rx65n_rspidev_s *priv, - uint8_t offset, uint8_t value) + uint8_t offset, uint8_t value) { putreg8(value, priv->rspibase + offset); } @@ -1018,8 +1018,8 @@ static void rspi_startxfr(struct rx65n_rspidev_s *priv) #ifdef CONFIG_RX65N_RSPI_DTC_DT_MODE static dtc_err_t rspi_dtctxsetup(FAR struct rx65n_rspidev_s *priv, - FAR const void *txbuffer, FAR const void *txdummy, - size_t nwords) + FAR const void *txbuffer, + FAR const void *txdummy, size_t nwords) { dtc_err_t ret = DTC_SUCCESS; dtc_dynamic_transfer_data_cfg_t dcfg; @@ -1075,7 +1075,7 @@ static dtc_err_t rspi_dtctxsetup(FAR struct rx65n_rspidev_s *priv, /* Configure the RX DTC */ ret = rx65n_dtc_setup_dynamic_transferdata(priv->dtchandle, priv->txvec, - (uint32_t)&dcfg, 0); + (uint32_t)&dcfg, 0); if (ret < 0) { spierr("ERROR:[%d] Fail to configure DTC information for TX\n", ret); @@ -1094,8 +1094,8 @@ static dtc_err_t rspi_dtctxsetup(FAR struct rx65n_rspidev_s *priv, ****************************************************************************/ static dtc_err_t rspi_dtcrxsetup(FAR struct rx65n_rspidev_s *priv, - FAR void *rxbuffer, FAR void *rxdummy, - size_t nwords) + FAR void *rxbuffer, FAR void *rxdummy, + size_t nwords) { dtc_err_t ret = DTC_SUCCESS; dtc_dynamic_transfer_data_cfg_t dcfg; @@ -1184,7 +1184,7 @@ static dtc_err_t rspi_dtcrxsetup(FAR struct rx65n_rspidev_s *priv, ****************************************************************************/ #ifdef CONFIG_RX65N_RSPI_SW_DT_MODE static int rspi_transfer(struct rx65n_rspidev_s *priv, const void *txbuffer, - void *rxbuffer, unsigned int nwords) + void *rxbuffer, unsigned int nwords) { uint8_t regval8; #ifndef CONFIG_SPI_POLLWAIT @@ -1295,7 +1295,7 @@ static int rspi_transfer(struct rx65n_rspidev_s *priv, const void *txbuffer, } #elif defined(CONFIG_RX65N_RSPI_DTC_DT_MODE) static int rspi_transfer(struct rx65n_rspidev_s *priv, const void *txbuffer, - void *rxbuffer, unsigned int nwords) + void *rxbuffer, unsigned int nwords) { uint8_t regval8; static uint16_t rxdummy = 0xffff; @@ -1738,7 +1738,7 @@ static int rspi_lock(FAR struct spi_dev_s *dev, bool lock) ****************************************************************************/ static uint32_t rspi_setfrequency(FAR struct spi_dev_s *dev, - uint32_t frequency) + uint32_t frequency) { struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev; uint32_t actual; @@ -1987,8 +1987,8 @@ static uint32_t rspi_send(FAR struct spi_dev_s *dev, uint32_t wd) #ifdef CONFIG_SPI_EXCHANGE static void rspi_exchange(FAR struct spi_dev_s *dev, - FAR const void *txbuffer, - FAR void *rxbuffer, size_t nwords) + FAR const void *txbuffer, + FAR void *rxbuffer, size_t nwords) { struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev; rspi_transfer(priv, txbuffer, rxbuffer, nwords); @@ -2017,7 +2017,7 @@ static void rspi_exchange(FAR struct spi_dev_s *dev, #ifndef CONFIG_SPI_EXCHANGE static void rspi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, - size_t nwords) + size_t nwords) { struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev; rspi_transfer(priv, buffer, NULL, nwords); @@ -2046,7 +2046,7 @@ static void rspi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, #ifndef CONFIG_SPI_EXCHANGE static void rspi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, - size_t nwords) + size_t nwords) { struct rx65n_rspidev_s *priv = (struct rx65n_rspidev_s *)dev; rspi_transfer(priv, NULL, buffer, nwords); @@ -2166,7 +2166,7 @@ void rspi_interrupt_init(FAR struct rx65n_rspidev_s *priv, uint8_t bus) * Return Value : none ****************************************************************************/ -static void rspi_power_on_off (uint8_t channel, uint8_t on_or_off) +static void rspi_power_on_off(uint8_t channel, uint8_t on_or_off) { SYSTEM.PRCR.WORD = 0xa50bu; @@ -2192,7 +2192,7 @@ static void rspi_power_on_off (uint8_t channel, uint8_t on_or_off) * Return Value : none ****************************************************************************/ -static void rspi_reg_protect (uint8_t enable) +static void rspi_reg_protect(uint8_t enable) { SYSTEM.PRCR.WORD = 0xa50b; MPC.PWPR.BIT.B0WI = 0; diff --git a/arch/renesas/src/rx65n/rx65n_rspi_sw.c b/arch/renesas/src/rx65n/rx65n_rspi_sw.c index 9a3a1d82d0..e20d836cde 100644 --- a/arch/renesas/src/rx65n/rx65n_rspi_sw.c +++ b/arch/renesas/src/rx65n/rx65n_rspi_sw.c @@ -277,10 +277,10 @@ static const struct spi_ops_s g_rspi0ops = static struct rx65n_rspidev_s g_rspi0dev = { - .rspidev = - { - &g_rspi0ops - }, + .rspidev = + { + .ops = &g_rspi0ops, + }, .rspibase = RX65N_RSPI0_BASE, .rspiclock = RX65N_PCLK_FREQUENCY, #ifndef CONFIG_SPI_POLLWAIT @@ -331,10 +331,10 @@ static const struct spi_ops_s g_rspi1ops = static struct rx65n_rspidev_s g_rspi1dev = { - .rspidev = - { - &g_rspi1ops - }, + .rspidev = + { + .ops = &g_rspi1ops, + }, .rspibase = RX65N_RSPI1_BASE, .rspiclock = RX65N_PCLK_FREQUENCY, #ifndef CONFIG_SPI_POLLWAIT @@ -385,10 +385,10 @@ static const struct spi_ops_s g_rspi2ops = static struct rx65n_rspidev_s g_rspi2dev = { - .rspidev = - { - &g_rspi2ops - }, + .rspidev = + { + .ops = &g_rspi2ops, + }, .rspibase = RX65N_RSPI2_BASE, .rspiclock = RX65N_PCLK_FREQUENCY, #ifndef CONFIG_SPI_POLLWAIT @@ -1796,7 +1796,7 @@ void rspi_interrupt_init(FAR struct rx65n_rspidev_s *priv, uint8_t bus) * Return Value : none ****************************************************************************/ -static void rspi_power_on_off (uint8_t channel, uint8_t on_or_off) +static void rspi_power_on_off(uint8_t channel, uint8_t on_or_off) { SYSTEM.PRCR.WORD = 0xa50bu; @@ -1822,7 +1822,7 @@ static void rspi_power_on_off (uint8_t channel, uint8_t on_or_off) * Return Value : none ****************************************************************************/ -static void rspi_reg_protect (uint8_t enable) +static void rspi_reg_protect(uint8_t enable) { SYSTEM.PRCR.WORD = 0xa50b; MPC.PWPR.BIT.B0WI = 0; diff --git a/arch/renesas/src/rx65n/rx65n_rtc_lowerhalf.c b/arch/renesas/src/rx65n/rx65n_rtc_lowerhalf.c index 17ddfc3372..e949d455ab 100644 --- a/arch/renesas/src/rx65n/rx65n_rtc_lowerhalf.c +++ b/arch/renesas/src/rx65n/rx65n_rtc_lowerhalf.c @@ -159,7 +159,7 @@ static const struct rtc_ops_s g_rtc_ops = static struct rx65n_lowerhalf_s g_rtc_lowerhalf = { - .ops = &g_rtc_ops, + .ops = &g_rtc_ops, .devlock = NXMUTEX_INITIALIZER, }; diff --git a/arch/renesas/src/rx65n/rx65n_usbhost.c b/arch/renesas/src/rx65n/rx65n_usbhost.c index ad6149d8e2..dcfbc01098 100644 --- a/arch/renesas/src/rx65n/rx65n_usbhost.c +++ b/arch/renesas/src/rx65n/rx65n_usbhost.c @@ -287,10 +287,10 @@ static uint8_t g_detached; #define rx65n_usbhost_getreg(addr) getreg16((volatile short *)addr) #define rx65n_usbhost_putreg(val,addr) putreg16(val,(volatile short *)addr) -static void rx65n_usbhost_setbit (volatile short *regadd, -uint16_t setbitval); -static void rx65n_usbhost_clearbit (volatile short *regadd, - uint16_t clearbitval); +static void rx65n_usbhost_setbit(volatile short *regadd, + uint16_t setbitval); +static void rx65n_usbhost_clearbit(volatile short *regadd, + uint16_t clearbitval); /* Semaphores ***************************************************************/ @@ -430,25 +430,25 @@ static inline void rx65n_usbhost_ep0init(struct rx65n_usbhost_s *priv); /* Prototype for USB Private Functions */ -static void usb_cstd_set_nak (uint16_t pipe); -static void usb_cstd_clr_transaction_counter (uint16_t trnreg); -void usb_hstd_read_lnst (uint16_t *buf); -void usb_hstd_chk_sof (void); -void usb_hstd_attach (uint16_t result); -void usb_hstd_detach (void); -static void usb_cstd_chg_curpipe (uint16_t pipe, uint16_t fifosel, - uint16_t isel); -static void usb_cstd_do_aclrm (uint16_t pipe); -static void usb_cstd_set_buf (uint16_t pipe); -static void usb_cstd_clr_stall (uint16_t pipe); -static void usb_cstd_pipe_init (uint16_t pipe); -void usb_hstd_bus_reset (void); -uint16_t usb_hstd_detach_process (void); -static uint16_t usb_cstd_get_pipe_dir (uint16_t pipe); -static void usb_cstd_clr_pipe_cnfg (uint16_t pipe_no); +static void usb_cstd_set_nak(uint16_t pipe); +static void usb_cstd_clr_transaction_counter(uint16_t trnreg); +void usb_hstd_read_lnst(uint16_t *buf); +void usb_hstd_chk_sof(void); +void usb_hstd_attach(uint16_t result); +void usb_hstd_detach(void); +static void usb_cstd_chg_curpipe(uint16_t pipe, uint16_t fifosel, + uint16_t isel); +static void usb_cstd_do_aclrm(uint16_t pipe); +static void usb_cstd_set_buf(uint16_t pipe); +static void usb_cstd_clr_stall(uint16_t pipe); +static void usb_cstd_pipe_init(uint16_t pipe); +void usb_hstd_bus_reset(void); +uint16_t usb_hstd_detach_process(void); +static uint16_t usb_cstd_get_pipe_dir(uint16_t pipe); +static void usb_cstd_clr_pipe_cnfg(uint16_t pipe_no); -static void *hw_usb_get_fifosel_adr (uint16_t pipemode); -static void *hw_usb_get_fifoctr_adr (uint16_t pipemode); +static void *hw_usb_get_fifosel_adr(uint16_t pipemode); +static void *hw_usb_get_fifoctr_adr(uint16_t pipemode); /**************************************************************************** * Private Data @@ -469,8 +469,8 @@ static struct rx65n_usbhost_s g_usbhost = static struct usbhost_connection_s g_usbconn = { - .wait = rx65n_usbhost_wait, - .enumerate = rx65n_usbhost_enumerate, + .wait = rx65n_usbhost_wait, + .enumerate = rx65n_usbhost_enumerate, }; /* This is a free list of EDs and TD buffers */ @@ -490,7 +490,7 @@ static struct rx65n_usbhost_xfrinfo_s g_xfrbuffers /* Prototype for interrupt bottom half function */ -static void rx65n_usbhost_bottomhalf (void *arg); +static void rx65n_usbhost_bottomhalf(void *arg); typedef struct usb_pipe_table { @@ -500,9 +500,9 @@ typedef struct usb_pipe_table uint16_t pipe_peri; } usb_pipe_table_t; -usb_pipe_table_t g_usb_pipe_table [USB_MAX_PIPE_NUM + 1]; +usb_pipe_table_t g_usb_pipe_table[USB_MAX_PIPE_NUM + 1]; -uint8_t kbd_report_data [8]; +uint8_t kbd_report_data[8]; uint8_t kbd_interrupt_in_pipe = 0; /**************************************************************************** @@ -511,43 +511,43 @@ uint8_t kbd_interrupt_in_pipe = 0; /* Prototypes to avoid errors */ -static uint16_t usb_cstd_get_buf_size (uint16_t pipe); -static uint16_t usb_cstd_is_set_frdy (uint16_t pipe, uint16_t fifosel, - uint16_t isel); -static uint16_t usb_cstd_get_maxpacket_size (uint16_t pipe); -uint8_t *usb_hstd_read_fifo (uint16_t count, uint16_t pipemode, - uint8_t *read_p); -static uint16_t usb_cstd_get_pid (uint16_t pipe); -uint8_t *usb_hstd_write_fifo (uint16_t count, uint16_t pipemode, - uint8_t *write_p); -static void usb_cstd_set_transaction_counter (uint16_t trnreg, - uint16_t trncnt); -static void usb_cstd_nrdy_enable (uint16_t pipe); -void usb_hstd_buf_to_fifo (uint8_t *buffer, size_t buflen, uint16_t pipe, - uint16_t useport); -void usb_hstd_forced_termination (uint16_t pipe, uint16_t status); -void usb_hstd_nrdy_endprocess (uint16_t pipe); +static uint16_t usb_cstd_get_buf_size(uint16_t pipe); +static uint16_t usb_cstd_is_set_frdy(uint16_t pipe, uint16_t fifosel, + uint16_t isel); +static uint16_t usb_cstd_get_maxpacket_size(uint16_t pipe); +uint8_t *usb_hstd_read_fifo(uint16_t count, uint16_t pipemode, + uint8_t *read_p); +static uint16_t usb_cstd_get_pid(uint16_t pipe); +uint8_t *usb_hstd_write_fifo(uint16_t count, uint16_t pipemode, + uint8_t *write_p); +static void usb_cstd_set_transaction_counter(uint16_t trnreg, + uint16_t trncnt); +static void usb_cstd_nrdy_enable(uint16_t pipe); +void usb_hstd_buf_to_fifo(uint8_t *buffer, size_t buflen, uint16_t pipe, + uint16_t useport); +void usb_hstd_forced_termination(uint16_t pipe, uint16_t status); +void usb_hstd_nrdy_endprocess(uint16_t pipe); /**************************************************************************** * Private Functions ****************************************************************************/ -static void rx65n_usbhost_setbit (volatile short *regadd, - uint16_t setbit_val) +static void rx65n_usbhost_setbit(volatile short *regadd, + uint16_t setbit_val) { volatile uint16_t value_to_set; value_to_set = rx65n_usbhost_getreg(regadd); value_to_set = value_to_set | setbit_val; - rx65n_usbhost_putreg (value_to_set, regadd); + rx65n_usbhost_putreg(value_to_set, regadd); } -static void rx65n_usbhost_clearbit (volatile short *regadd, - uint16_t clearbit_val) +static void rx65n_usbhost_clearbit(volatile short *regadd, + uint16_t clearbit_val) { volatile uint16_t value_to_clear; value_to_clear = rx65n_usbhost_getreg(regadd); value_to_clear = value_to_clear & (~clearbit_val); - rx65n_usbhost_putreg (value_to_clear, regadd); + rx65n_usbhost_putreg(value_to_clear, regadd); } /**************************************************************************** @@ -557,7 +557,7 @@ static void rx65n_usbhost_clearbit (volatile short *regadd, * Return value : LNST bit value ****************************************************************************/ -uint16_t usb_chattaring (uint16_t *syssts) +uint16_t usb_chattaring(uint16_t *syssts) { uint16_t lnst[4]; @@ -587,9 +587,9 @@ uint16_t usb_chattaring (uint16_t *syssts) * Return value : none ****************************************************************************/ -void hw_usb_hset_enb_ovrcre (void) +void hw_usb_hset_enb_ovrcre(void) { - rx65n_usbhost_setbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_OVRCRE); + rx65n_usbhost_setbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_OVRCRE); } /**************************************************************************** @@ -600,9 +600,9 @@ void hw_usb_hset_enb_ovrcre (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_enb_ovrcre (void) +void hw_usb_hclear_enb_ovrcre(void) { - rx65n_usbhost_clearbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_OVRCRE); + rx65n_usbhost_clearbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_OVRCRE); } /**************************************************************************** @@ -615,9 +615,9 @@ void hw_usb_hclear_enb_ovrcre (void) * Return value : none ****************************************************************************/ -void hw_usb_hset_enb_bchge (void) +void hw_usb_hset_enb_bchge(void) { - rx65n_usbhost_setbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_BCHGE); + rx65n_usbhost_setbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_BCHGE); } /**************************************************************************** @@ -628,9 +628,9 @@ void hw_usb_hset_enb_bchge (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_enb_bchge (void) +void hw_usb_hclear_enb_bchge(void) { - rx65n_usbhost_clearbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_BCHGE); + rx65n_usbhost_clearbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_BCHGE); } /**************************************************************************** @@ -641,9 +641,9 @@ void hw_usb_hclear_enb_bchge (void) * Return value : none ****************************************************************************/ -void hw_usb_hset_enb_dtche (void) +void hw_usb_hset_enb_dtche(void) { - rx65n_usbhost_setbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_DTCHE); + rx65n_usbhost_setbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_DTCHE); } /**************************************************************************** @@ -654,9 +654,9 @@ void hw_usb_hset_enb_dtche (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_enb_dtche (void) +void hw_usb_hclear_enb_dtche(void) { - rx65n_usbhost_clearbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_DTCHE); + rx65n_usbhost_clearbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_DTCHE); } /**************************************************************************** @@ -667,9 +667,9 @@ void hw_usb_hclear_enb_dtche (void) * Return value : none ****************************************************************************/ -void hw_usb_hset_enb_attche (void) +void hw_usb_hset_enb_attche(void) { - rx65n_usbhost_setbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_ATTCHE); + rx65n_usbhost_setbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_ATTCHE); } /**************************************************************************** @@ -680,9 +680,9 @@ void hw_usb_hset_enb_attche (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_enb_attche (void) +void hw_usb_hclear_enb_attche(void) { - rx65n_usbhost_clearbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_ATTCHE); + rx65n_usbhost_clearbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_ATTCHE); } /**************************************************************************** @@ -693,9 +693,9 @@ void hw_usb_hclear_enb_attche (void) * Return value : none ****************************************************************************/ -void hw_usb_hset_enb_signe (void) +void hw_usb_hset_enb_signe(void) { - rx65n_usbhost_setbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_SIGNE); + rx65n_usbhost_setbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_SIGNE); } /**************************************************************************** @@ -706,9 +706,9 @@ void hw_usb_hset_enb_signe (void) * Return value : none ****************************************************************************/ -void hw_usb_hset_enb_sacke (void) +void hw_usb_hset_enb_sacke(void) { - rx65n_usbhost_setbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_SACKE); + rx65n_usbhost_setbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_SACKE); } /**************************************************************************** @@ -719,10 +719,10 @@ void hw_usb_hset_enb_sacke (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_sts_ovrcr (void) +void hw_usb_hclear_sts_ovrcr(void) { - rx65n_usbhost_putreg (((~RX65N_USB_INTSTS1_OVRCRE) & - INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); + rx65n_usbhost_putreg(((~RX65N_USB_INTSTS1_OVRCRE) & + INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); } /**************************************************************************** @@ -733,10 +733,10 @@ void hw_usb_hclear_sts_ovrcr (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_sts_bchg (void) +void hw_usb_hclear_sts_bchg(void) { - rx65n_usbhost_putreg (((~RX65N_USB_INTSTS1_BCHG) & - INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); + rx65n_usbhost_putreg(((~RX65N_USB_INTSTS1_BCHG) & + INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); } /**************************************************************************** @@ -747,10 +747,10 @@ void hw_usb_hclear_sts_bchg (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_sts_dtch (void) +void hw_usb_hclear_sts_dtch(void) { - rx65n_usbhost_putreg (((~RX65N_USB_INTSTS1_DTCH) & - INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); + rx65n_usbhost_putreg(((~RX65N_USB_INTSTS1_DTCH) & + INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); } /**************************************************************************** @@ -761,10 +761,10 @@ void hw_usb_hclear_sts_dtch (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_sts_attch (void) +void hw_usb_hclear_sts_attch(void) { - rx65n_usbhost_putreg (((~RX65N_USB_INTSTS1_ATTCH) & - INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); + rx65n_usbhost_putreg(((~RX65N_USB_INTSTS1_ATTCH) & + INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); } /**************************************************************************** @@ -775,10 +775,10 @@ void hw_usb_hclear_sts_attch (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_sts_sign (void) +void hw_usb_hclear_sts_sign(void) { - rx65n_usbhost_putreg (((~RX65N_USB_INTSTS1_SIGN) & - INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); + rx65n_usbhost_putreg(((~RX65N_USB_INTSTS1_SIGN) & + INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); } /**************************************************************************** @@ -790,10 +790,10 @@ void hw_usb_hclear_sts_sign (void) * Return value : none ****************************************************************************/ -void hw_usb_hclear_sts_sack (void) +void hw_usb_hclear_sts_sack(void) { - rx65n_usbhost_putreg (((~RX65N_USB_INTSTS1_SACK) & - INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); + rx65n_usbhost_putreg(((~RX65N_USB_INTSTS1_SACK) & + INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); } /**************************************************************************** @@ -803,9 +803,9 @@ void hw_usb_hclear_sts_sack (void) * Return value : none ****************************************************************************/ -void hw_usb_hwrite_dcpctr (uint16_t data) +void hw_usb_hwrite_dcpctr(uint16_t data) { - rx65n_usbhost_putreg (data, RX65N_USB_DCPCTR); + rx65n_usbhost_putreg(data, RX65N_USB_DCPCTR); } /**************************************************************************** @@ -817,9 +817,9 @@ void hw_usb_hwrite_dcpctr (uint16_t data) * Return value : none ****************************************************************************/ -void hw_usb_hset_sureq (void) +void hw_usb_hset_sureq(void) { - rx65n_usbhost_setbit (RX65N_USB_DCPCTR, RX65N_USB_DCPCTR_SUREQ); + rx65n_usbhost_setbit(RX65N_USB_DCPCTR, RX65N_USB_DCPCTR_SUREQ); } /**************************************************************************** @@ -830,7 +830,7 @@ void hw_usb_hset_sureq (void) * Return value : DEVADDx content ****************************************************************************/ -uint16_t hw_usb_hread_devadd (uint16_t devsel) +uint16_t hw_usb_hread_devadd(uint16_t devsel) { volatile uint16_t *preg; uint16_t devadr; @@ -846,7 +846,7 @@ uint16_t hw_usb_hread_devadd (uint16_t devsel) } else { - preg = (uint16_t *) ((RX65N_USB_DEVADD0) + (devadr)); + preg = (uint16_t *)((RX65N_USB_DEVADD0) + (devadr)); return_value = ((*preg)); return return_value; } @@ -861,14 +861,14 @@ uint16_t hw_usb_hread_devadd (uint16_t devsel) * Return value : none ****************************************************************************/ -void hw_usb_hset_usbspd (uint16_t devsel, uint8_t data) +void hw_usb_hset_usbspd(uint16_t devsel, uint8_t data) { volatile uint16_t *preg; uint16_t devadr; devadr = devsel; - preg = (uint16_t *) (RX65N_USB_DEVADD0 + devadr); + preg = (uint16_t *)(RX65N_USB_DEVADD0 + devadr); (*preg) &= (~RX65N_USB_DEVSPD); @@ -882,11 +882,11 @@ void hw_usb_hset_usbspd (uint16_t devsel, uint8_t data) * Return value : none ****************************************************************************/ -void hw_usb_hmodule_init (void) +void hw_usb_hmodule_init(void) { uint16_t sts; - rx65n_usbhost_setbit (RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_SCKE); + rx65n_usbhost_setbit(RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_SCKE); up_mdelay(1); /* wait until SCKE bit is set */ @@ -901,28 +901,28 @@ void hw_usb_hmodule_init (void) putreg32(0x05, RX65N_USB_PHYSLEW); - rx65n_usbhost_setbit (RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_DCFM); + rx65n_usbhost_setbit(RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_DCFM); - rx65n_usbhost_setbit (RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_DRPD); + rx65n_usbhost_setbit(RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_DRPD); - sts = usb_chattaring((uint16_t *) RX65N_USB_SYSSTS0); + sts = usb_chattaring((uint16_t *)RX65N_USB_SYSSTS0); - rx65n_usbhost_setbit (RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_USBE); + rx65n_usbhost_setbit(RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_USBE); - rx65n_usbhost_setbit (RX65N_USB_CFIFOSEL, RX65N_USB_CFIFOSEL_MBW_16); - rx65n_usbhost_setbit (RX65N_USB_D0FIFOSEL, RX65N_USB_DFIFOSEL_MBW_16); - rx65n_usbhost_setbit (RX65N_USB_D1FIFOSEL, RX65N_USB_DFIFOSEL_MBW_16); + rx65n_usbhost_setbit(RX65N_USB_CFIFOSEL, RX65N_USB_CFIFOSEL_MBW_16); + rx65n_usbhost_setbit(RX65N_USB_D0FIFOSEL, RX65N_USB_DFIFOSEL_MBW_16); + rx65n_usbhost_setbit(RX65N_USB_D1FIFOSEL, RX65N_USB_DFIFOSEL_MBW_16); switch (sts) { - case RX65N_USB_SYSSTS0_LNST_LS_JSTS : - case RX65N_USB_SYSSTS0_LNST_FS_JSTS : /* USB device already connected */ + case RX65N_USB_SYSSTS0_LNST_LS_JSTS: + case RX65N_USB_SYSSTS0_LNST_FS_JSTS: /* USB device already connected */ - syslog (LOG_INFO, "USB Device already connected\n"); - rx65n_usbhost_setbit (RX65N_USB_DVSTCTR0, RX65N_USB_DVSTCTR0_USBRST); + syslog(LOG_INFO, "USB Device already connected\n"); + rx65n_usbhost_setbit(RX65N_USB_DVSTCTR0, RX65N_USB_DVSTCTR0_USBRST); up_mdelay(20); /* Need to wait greater equal 10ms in USB spec */ - rx65n_usbhost_clearbit (RX65N_USB_DVSTCTR0, - RX65N_USB_DVSTCTR0_USBRST); + rx65n_usbhost_clearbit(RX65N_USB_DVSTCTR0, + RX65N_USB_DVSTCTR0_USBRST); /* WAIT_LOOP */ @@ -938,27 +938,27 @@ void hw_usb_hmodule_init (void) RX65N_USB_DVSTCTR0_RHST) == RX65N_USB_DVSTCTR0_SPEED_LOW) { - rx65n_usbhost_setbit (RX65N_USB_SOFCFG, + rx65n_usbhost_setbit(RX65N_USB_SOFCFG, RX65N_USB_SOFCFG_TRNENSEL); } - rx65n_usbhost_setbit (RX65N_USB_DVSTCTR0, + rx65n_usbhost_setbit(RX65N_USB_DVSTCTR0, RX65N_USB_DVSTCTR0_UACT); break; - case RX65N_USB_SYSSTS0_LNST_SE0 : /* USB device not connected */ - rx65n_usbhost_setbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_ATTCHE); + case RX65N_USB_SYSSTS0_LNST_SE0: /* USB device not connected */ + rx65n_usbhost_setbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_ATTCHE); break; - default : + default: break; } - rx65n_usbhost_putreg (((~RX65N_USB_INTSTS1_OVRCRE) & + rx65n_usbhost_putreg(((~RX65N_USB_INTSTS1_OVRCRE) & INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); - rx65n_usbhost_setbit (RX65N_USB_INTENB0, (RX65N_USB_INTENB0_BEMPE | + rx65n_usbhost_setbit(RX65N_USB_INTENB0, (RX65N_USB_INTENB0_BEMPE | RX65N_USB_INTENB0_NRDYE | RX65N_USB_INTENB0_BRDYE)); - rx65n_usbhost_setbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_ATTCHE); + rx65n_usbhost_setbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_ATTCHE); } /**************************************************************************** @@ -968,9 +968,9 @@ void hw_usb_hmodule_init (void) * Return value : SYSCFG content. ****************************************************************************/ -uint16_t hw_usb_read_syscfg (void) +uint16_t hw_usb_read_syscfg(void) { - return (rx65n_usbhost_getreg(RX65N_USB_SYSCFG)); + return rx65n_usbhost_getreg(RX65N_USB_SYSCFG); } /**************************************************************************** @@ -980,9 +980,9 @@ uint16_t hw_usb_read_syscfg (void) * Return value : none ****************************************************************************/ -void hw_usb_set_usbe (void) +void hw_usb_set_usbe(void) { - rx65n_usbhost_setbit (RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_USBE); + rx65n_usbhost_setbit(RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_USBE); } /**************************************************************************** @@ -992,9 +992,9 @@ void hw_usb_set_usbe (void) * Return value : none ****************************************************************************/ -void hw_usb_clear_usbe (void) +void hw_usb_clear_usbe(void) { - rx65n_usbhost_clearbit (RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_USBE); + rx65n_usbhost_clearbit(RX65N_USB_SYSCFG, RX65N_USB_SYSCFG_USBE); } /**************************************************************************** @@ -1005,9 +1005,9 @@ void hw_usb_clear_usbe (void) * Return value : SYSSTS0 content ****************************************************************************/ -static uint16_t hw_usb_read_syssts (void) +static uint16_t hw_usb_read_syssts(void) { - return (rx65n_usbhost_getreg(RX65N_USB_SYSSTS0)); + return rx65n_usbhost_getreg(RX65N_USB_SYSSTS0); } /**************************************************************************** @@ -1017,9 +1017,9 @@ static uint16_t hw_usb_read_syssts (void) * Return value : DVSTCTR0 content ****************************************************************************/ -static uint16_t hw_usb_read_dvstctr (void) +static uint16_t hw_usb_read_dvstctr(void) { - return (rx65n_usbhost_getreg(RX65N_USB_DVSTCTR0)); + return rx65n_usbhost_getreg(RX65N_USB_DVSTCTR0); } /**************************************************************************** @@ -1030,11 +1030,11 @@ static uint16_t hw_usb_read_dvstctr (void) * Return value : none ****************************************************************************/ -void hw_usb_rmw_dvstctr (uint16_t data, uint16_t bitptn) +void hw_usb_rmw_dvstctr(uint16_t data, uint16_t bitptn) { uint16_t buf; - buf = rx65n_usbhost_getreg (RX65N_USB_DVSTCTR0); + buf = rx65n_usbhost_getreg(RX65N_USB_DVSTCTR0); buf &= (~bitptn); buf |= (data & bitptn); @@ -1049,9 +1049,9 @@ void hw_usb_rmw_dvstctr (uint16_t data, uint16_t bitptn) * Return value : none ****************************************************************************/ -void hw_usb_clear_dvstctr (uint16_t bitptn) +void hw_usb_clear_dvstctr(uint16_t bitptn) { - rx65n_usbhost_clearbit (RX65N_USB_DVSTCTR0, bitptn); + rx65n_usbhost_clearbit(RX65N_USB_DVSTCTR0, bitptn); } /**************************************************************************** @@ -1062,9 +1062,9 @@ void hw_usb_clear_dvstctr (uint16_t bitptn) * Return value : none ****************************************************************************/ -void hw_usb_set_vbout (void) +void hw_usb_set_vbout(void) { - rx65n_usbhost_setbit (RX65N_USB_DVSTCTR0, RX65N_USB_DVSTCTR0_VBUSEN); + rx65n_usbhost_setbit(RX65N_USB_DVSTCTR0, RX65N_USB_DVSTCTR0_VBUSEN); } /**************************************************************************** @@ -1075,9 +1075,9 @@ void hw_usb_set_vbout (void) * Return value : none ****************************************************************************/ -void hw_usb_clear_vbout (void) +void hw_usb_clear_vbout(void) { - rx65n_usbhost_clearbit (RX65N_USB_DVSTCTR0, RX65N_USB_DVSTCTR0_VBUSEN); + rx65n_usbhost_clearbit(RX65N_USB_DVSTCTR0, RX65N_USB_DVSTCTR0_VBUSEN); } /**************************************************************************** @@ -1088,27 +1088,27 @@ void hw_usb_clear_vbout (void) * Return value : CFIFO/D0FIFO/D1FIFO content (16-bit) ****************************************************************************/ -static uint16_t hw_usb_read_fifo16 (uint16_t pipemode) +static uint16_t hw_usb_read_fifo16(uint16_t pipemode) { uint16_t data = 0; switch (pipemode) { - case RX65N_USB_USING_CFIFO : + case RX65N_USB_USING_CFIFO: data = USB0.CFIFO.WORD; break; - case RX65N_USB_USING_D0FIFO : - data = rx65n_usbhost_getreg (RX65N_USB_D0FIFO); + case RX65N_USB_USING_D0FIFO: + data = rx65n_usbhost_getreg(RX65N_USB_D0FIFO); break; - case RX65N_USB_USING_D1FIFO : - data = rx65n_usbhost_getreg (RX65N_USB_D1FIFO); + case RX65N_USB_USING_D1FIFO: + data = rx65n_usbhost_getreg(RX65N_USB_D1FIFO); break; - default : - syslog (LOG_INFO, "Debug : %s(): Line : %d what is this \ - pipe mode?? %d\n", __func__, __LINE__, pipemode); + default: + syslog(LOG_INFO, "Debug : %s(): Line : %d what is this \ + pipe mode?? %d\n", __func__, __LINE__, pipemode); break; } @@ -1125,25 +1125,25 @@ static uint16_t hw_usb_read_fifo16 (uint16_t pipemode) * Return value : none ****************************************************************************/ -static void hw_usb_write_fifo16 (uint16_t pipemode, uint16_t data) +static void hw_usb_write_fifo16(uint16_t pipemode, uint16_t data) { switch (pipemode) { - case RX65N_USB_USING_CFIFO : - data = rx65n_usbhost_putreg (data, RX65N_USB_CFIFO); + case RX65N_USB_USING_CFIFO: + data = rx65n_usbhost_putreg(data, RX65N_USB_CFIFO); break; - case RX65N_USB_USING_D0FIFO : - data = rx65n_usbhost_putreg (data, RX65N_USB_D0FIFO); + case RX65N_USB_USING_D0FIFO: + data = rx65n_usbhost_putreg(data, RX65N_USB_D0FIFO); break; - case RX65N_USB_USING_D1FIFO : - data = rx65n_usbhost_putreg (data, RX65N_USB_D1FIFO); + case RX65N_USB_USING_D1FIFO: + data = rx65n_usbhost_putreg(data, RX65N_USB_D1FIFO); break; - default : - syslog (LOG_INFO, "Debug : %s(): Line : %d what is this \ - pipe mode?? %d\n", __func__, __LINE__, pipemode); + default: + syslog(LOG_INFO, "Debug : %s(): Line : %d what is this \ + pipe mode?? %d\n", __func__, __LINE__, pipemode); break; } } @@ -1158,34 +1158,34 @@ static void hw_usb_write_fifo16 (uint16_t pipemode, uint16_t data) * Return value : none ****************************************************************************/ -static void hw_usb_write_fifo8 (uint16_t pipemode, uint8_t data) +static void hw_usb_write_fifo8(uint16_t pipemode, uint8_t data) { switch (pipemode) { - case USB_CUSE : + case USB_CUSE: /* USB0_CFIFO8 = data; */ - putreg8 (data, RX65N_USB_CFIFO); + putreg8(data, RX65N_USB_CFIFO); break; - case USB_D0USE : + case USB_D0USE: /* USB0_D0FIFO8 = data; */ - putreg8 (data, RX65N_USB_D0FIFO); + putreg8(data, RX65N_USB_D0FIFO); break; - case USB_D1USE : + case USB_D1USE: /* USB0_D1FIFO8 = data; */ - putreg8 (data, RX65N_USB_D1FIFO); + putreg8(data, RX65N_USB_D1FIFO); break; - default : - syslog (LOG_INFO, "Debug : %s(): Line : %d Debug hook...\n", - __func__, __LINE__); + default: + syslog(LOG_INFO, "Debug : %s(): Line : %d Debug hook...\n", + __func__, __LINE__); break; } } @@ -1198,28 +1198,28 @@ static void hw_usb_write_fifo8 (uint16_t pipemode, uint8_t data) * Return value : none ****************************************************************************/ -static void *hw_usb_get_fifosel_adr (uint16_t pipemode) +static void *hw_usb_get_fifosel_adr(uint16_t pipemode) { void *p_reg = NULL; switch (pipemode) { - case RX65N_USB_USING_CFIFO : + case RX65N_USB_USING_CFIFO: p_reg = (void *)RX65N_USB_CFIFOSEL; break; - case RX65N_USB_USING_D0FIFO : + case RX65N_USB_USING_D0FIFO: p_reg = (void *)RX65N_USB_D0FIFOSEL; break; - case RX65N_USB_USING_D1FIFO : + case RX65N_USB_USING_D1FIFO: p_reg = (void *)RX65N_USB_D1FIFOSEL; break; - default : - syslog (LOG_INFO, - "Debug : %s(): Line : %d what is this pipe mode?? %d\n", - __func__, __LINE__, pipemode); + default: + syslog(LOG_INFO, + "Debug : %s(): Line : %d what is this pipe mode?? %d\n", + __func__, __LINE__, pipemode); break; } @@ -1234,11 +1234,11 @@ static void *hw_usb_get_fifosel_adr (uint16_t pipemode) * Return value : FIFOSEL content ****************************************************************************/ -static uint16_t hw_usb_read_fifosel (uint16_t pipemode) +static uint16_t hw_usb_read_fifosel(uint16_t pipemode) { volatile uint16_t *p_reg; - p_reg = (uint16_t *) hw_usb_get_fifosel_adr(pipemode); + p_reg = (uint16_t *)hw_usb_get_fifosel_adr(pipemode); return *p_reg; } @@ -1255,13 +1255,13 @@ static uint16_t hw_usb_read_fifosel (uint16_t pipemode) * Return value : none ****************************************************************************/ -static void hw_usb_rmw_fifosel (uint16_t pipemode, uint16_t data, - uint16_t bitptn) +static void hw_usb_rmw_fifosel(uint16_t pipemode, uint16_t data, + uint16_t bitptn) { uint16_t buf; volatile uint16_t *p_reg; - p_reg = (uint16_t *) hw_usb_get_fifosel_adr(pipemode); + p_reg = (uint16_t *)hw_usb_get_fifosel_adr(pipemode); buf = *p_reg; buf &= (~bitptn); @@ -1280,7 +1280,7 @@ static void hw_usb_rmw_fifosel (uint16_t pipemode, uint16_t data, * Return value : none ****************************************************************************/ -static void hw_usb_set_mbw (uint16_t pipemode, uint16_t data) +static void hw_usb_set_mbw(uint16_t pipemode, uint16_t data) { volatile uint16_t *p_reg; @@ -1302,7 +1302,7 @@ static void hw_usb_set_mbw (uint16_t pipemode, uint16_t data) * Return value : none ****************************************************************************/ -static void hw_usb_set_curpipe (uint16_t pipemode, uint16_t pipeno) +static void hw_usb_set_curpipe(uint16_t pipemode, uint16_t pipeno) { volatile uint16_t *p_reg; volatile uint16_t reg; @@ -1337,27 +1337,27 @@ static void hw_usb_set_curpipe (uint16_t pipemode, uint16_t pipeno) * Return value : none ****************************************************************************/ -static void *hw_usb_get_fifoctr_adr (uint16_t pipemode) +static void *hw_usb_get_fifoctr_adr(uint16_t pipemode) { void *p_reg = NULL; switch (pipemode) { - case RX65N_USB_USING_CFIFO : + case RX65N_USB_USING_CFIFO: p_reg = (void *)RX65N_USB_CFIFOCTR; break; - case RX65N_USB_USING_D0FIFO : + case RX65N_USB_USING_D0FIFO: p_reg = (void *)RX65N_USB_D0FIFOCTR; break; - case RX65N_USB_USING_D1FIFO : + case RX65N_USB_USING_D1FIFO: p_reg = (void *)RX65N_USB_D0FIFOCTR; break; - default : - syslog (LOG_INFO, "Debug : %s(): Line : %d what is this \ - pipe mode?? %d\n", - __func__, __LINE__, pipemode); + default: + syslog(LOG_INFO, "Debug : %s(): Line : %d what is this \ + pipe mode?? %d\n", + __func__, __LINE__, pipemode); break; } @@ -1372,11 +1372,11 @@ static void *hw_usb_get_fifoctr_adr (uint16_t pipemode) * Return value : FIFOCTR content ****************************************************************************/ -static uint16_t hw_usb_read_fifoctr (uint16_t pipemode) +static uint16_t hw_usb_read_fifoctr(uint16_t pipemode) { volatile uint16_t *p_reg; - p_reg = (uint16_t *) hw_usb_get_fifoctr_adr(pipemode); + p_reg = (uint16_t *)hw_usb_get_fifoctr_adr(pipemode); return *p_reg; } @@ -1389,11 +1389,11 @@ static uint16_t hw_usb_read_fifoctr (uint16_t pipemode) * Return value : none ****************************************************************************/ -static void hw_usb_set_bval (uint16_t pipemode) +static void hw_usb_set_bval(uint16_t pipemode) { volatile uint16_t *p_reg; - p_reg = (uint16_t *) hw_usb_get_fifoctr_adr(pipemode); + p_reg = (uint16_t *)hw_usb_get_fifoctr_adr(pipemode); (*p_reg) |= RX65N_USB_FIFOCTR_BVAL; } @@ -1406,11 +1406,11 @@ static void hw_usb_set_bval (uint16_t pipemode) * Return value : none ****************************************************************************/ -static void hw_usb_set_bclr (uint16_t pipemode) +static void hw_usb_set_bclr(uint16_t pipemode) { volatile uint16_t *p_reg; - p_reg = (uint16_t *) hw_usb_get_fifoctr_adr(pipemode); + p_reg = (uint16_t *)hw_usb_get_fifoctr_adr(pipemode); *p_reg = RX65N_USB_FIFOCTR_BCLR; } @@ -1424,9 +1424,9 @@ static void hw_usb_set_bclr (uint16_t pipemode) * Return value : none ****************************************************************************/ -void hw_usb_set_intenb (uint16_t data) +void hw_usb_set_intenb(uint16_t data) { - rx65n_usbhost_setbit (RX65N_USB_INTENB0, data); + rx65n_usbhost_setbit(RX65N_USB_INTENB0, data); } /**************************************************************************** @@ -1437,9 +1437,9 @@ void hw_usb_set_intenb (uint16_t data) * Return value : none ****************************************************************************/ -static void hw_usb_set_brdyenb (uint16_t pipeno) +static void hw_usb_set_brdyenb(uint16_t pipeno) { - rx65n_usbhost_setbit (RX65N_USB_BRDYENB, (1 << pipeno)); + rx65n_usbhost_setbit(RX65N_USB_BRDYENB, (1 << pipeno)); } /**************************************************************************** @@ -1450,9 +1450,9 @@ static void hw_usb_set_brdyenb (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_clear_brdyenb (uint16_t pipeno) +static void hw_usb_clear_brdyenb(uint16_t pipeno) { - rx65n_usbhost_clearbit (RX65N_USB_BRDYENB, (1 << pipeno)); + rx65n_usbhost_clearbit(RX65N_USB_BRDYENB, (1 << pipeno)); } /**************************************************************************** @@ -1463,9 +1463,9 @@ static void hw_usb_clear_brdyenb (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_set_nrdyenb (uint16_t pipeno) +static void hw_usb_set_nrdyenb(uint16_t pipeno) { - rx65n_usbhost_setbit (RX65N_USB_NRDYENB, (1 << pipeno)); + rx65n_usbhost_setbit(RX65N_USB_NRDYENB, (1 << pipeno)); } /**************************************************************************** @@ -1476,9 +1476,9 @@ static void hw_usb_set_nrdyenb (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_clear_nrdyenb (uint16_t pipeno) +static void hw_usb_clear_nrdyenb(uint16_t pipeno) { - rx65n_usbhost_clearbit (RX65N_USB_NRDYENB, (1 << pipeno)); + rx65n_usbhost_clearbit(RX65N_USB_NRDYENB, (1 << pipeno)); } /**************************************************************************** @@ -1489,9 +1489,9 @@ static void hw_usb_clear_nrdyenb (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_set_bempenb (uint16_t pipeno) +static void hw_usb_set_bempenb(uint16_t pipeno) { - rx65n_usbhost_setbit (RX65N_USB_BEMPENB, (1 << pipeno)); + rx65n_usbhost_setbit(RX65N_USB_BEMPENB, (1 << pipeno)); } /**************************************************************************** @@ -1502,9 +1502,9 @@ static void hw_usb_set_bempenb (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_clear_bempenb (uint16_t pipeno) +static void hw_usb_clear_bempenb(uint16_t pipeno) { - rx65n_usbhost_clearbit (RX65N_USB_BEMPENB, (1 << pipeno)); + rx65n_usbhost_clearbit(RX65N_USB_BEMPENB, (1 << pipeno)); } /**************************************************************************** @@ -1515,9 +1515,9 @@ static void hw_usb_clear_bempenb (uint16_t pipeno) * Return value : none ****************************************************************************/ -void hw_usb_clear_sts_sofr (void) +void hw_usb_clear_sts_sofr(void) { - rx65n_usbhost_clearbit (RX65N_USB_INTSTS0, RX65N_USB_INTSTS0_SOFR); + rx65n_usbhost_clearbit(RX65N_USB_INTSTS0, RX65N_USB_INTSTS0_SOFR); } /**************************************************************************** @@ -1528,7 +1528,7 @@ void hw_usb_clear_sts_sofr (void) * Return value : none ****************************************************************************/ -static void hw_usb_clear_sts_brdy (uint16_t pipeno) +static void hw_usb_clear_sts_brdy(uint16_t pipeno) { rx65n_usbhost_putreg((~(1 << pipeno)) & RX65N_USB_PIPE_ALL, RX65N_USB_BRDYSTS); @@ -1542,7 +1542,7 @@ static void hw_usb_clear_sts_brdy (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_clear_status_nrdy (uint16_t pipeno) +static void hw_usb_clear_status_nrdy(uint16_t pipeno) { rx65n_usbhost_putreg((~(1 << pipeno)) & RX65N_USB_PIPE_ALL, RX65N_USB_NRDYSTS); @@ -1556,7 +1556,7 @@ static void hw_usb_clear_status_nrdy (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_clear_status_bemp (uint16_t pipeno) +static void hw_usb_clear_status_bemp(uint16_t pipeno) { rx65n_usbhost_putreg((~(1 << pipeno)) & RX65N_USB_PIPE_ALL, RX65N_USB_BEMPSTS); @@ -1569,9 +1569,9 @@ static void hw_usb_clear_status_bemp (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_write_dcpcfg (uint16_t data) +static void hw_usb_write_dcpcfg(uint16_t data) { - rx65n_usbhost_putreg (data, RX65N_USB_DCPCFG); + rx65n_usbhost_putreg(data, RX65N_USB_DCPCFG); } /**************************************************************************** @@ -1581,9 +1581,9 @@ static void hw_usb_write_dcpcfg (uint16_t data) * Return value : DCPMAXP content ****************************************************************************/ -static uint16_t hw_usb_read_dcpmaxp (void) +static uint16_t hw_usb_read_dcpmaxp(void) { - return rx65n_usbhost_getreg (RX65N_USB_DCPMAXP); + return rx65n_usbhost_getreg(RX65N_USB_DCPMAXP); } /**************************************************************************** @@ -1593,9 +1593,9 @@ static uint16_t hw_usb_read_dcpmaxp (void) * Return value : none ****************************************************************************/ -static void hw_usb_write_dcpmxps (uint16_t data) +static void hw_usb_write_dcpmxps(uint16_t data) { - rx65n_usbhost_putreg (data, RX65N_USB_DCPMAXP); + rx65n_usbhost_putreg(data, RX65N_USB_DCPMAXP); } /**************************************************************************** @@ -1605,9 +1605,9 @@ static void hw_usb_write_dcpmxps (uint16_t data) * Return value : none ****************************************************************************/ -static void hw_usb_write_pipesel (uint16_t data) +static void hw_usb_write_pipesel(uint16_t data) { - rx65n_usbhost_putreg (data, RX65N_USB_PIPESEL); + rx65n_usbhost_putreg(data, RX65N_USB_PIPESEL); } /**************************************************************************** @@ -1617,9 +1617,9 @@ static void hw_usb_write_pipesel (uint16_t data) * Return value : PIPECFG content ****************************************************************************/ -static uint16_t hw_usb_read_pipecfg (void) +static uint16_t hw_usb_read_pipecfg(void) { - return rx65n_usbhost_getreg (RX65N_USB_PIPECFG); + return rx65n_usbhost_getreg(RX65N_USB_PIPECFG); } /**************************************************************************** @@ -1629,9 +1629,9 @@ static uint16_t hw_usb_read_pipecfg (void) * Return value : none ****************************************************************************/ -static void hw_usb_write_pipecfg (uint16_t data) +static void hw_usb_write_pipecfg(uint16_t data) { - rx65n_usbhost_putreg (data, RX65N_USB_PIPECFG); + rx65n_usbhost_putreg(data, RX65N_USB_PIPECFG); } /**************************************************************************** @@ -1641,9 +1641,9 @@ static void hw_usb_write_pipecfg (uint16_t data) * Return value : PIPEMAXP content ****************************************************************************/ -static uint16_t hw_usb_read_pipemaxp (void) +static uint16_t hw_usb_read_pipemaxp(void) { - return rx65n_usbhost_getreg (RX65N_USB_PIPEMAXP); + return rx65n_usbhost_getreg(RX65N_USB_PIPEMAXP); } /**************************************************************************** @@ -1653,9 +1653,9 @@ static uint16_t hw_usb_read_pipemaxp (void) * Return value : none ****************************************************************************/ -static void hw_usb_write_pipemaxp (uint16_t data) +static void hw_usb_write_pipemaxp(uint16_t data) { - rx65n_usbhost_putreg (data, RX65N_USB_PIPEMAXP); + rx65n_usbhost_putreg(data, RX65N_USB_PIPEMAXP); } /**************************************************************************** @@ -1665,9 +1665,9 @@ static void hw_usb_write_pipemaxp (uint16_t data) * Return value : none ****************************************************************************/ -static void hw_usb_write_pipeperi (uint16_t data) +static void hw_usb_write_pipeperi(uint16_t data) { - rx65n_usbhost_putreg (data, RX65N_USB_PIPEPERI); + rx65n_usbhost_putreg(data, RX65N_USB_PIPEPERI); } /**************************************************************************** @@ -1679,7 +1679,7 @@ static void hw_usb_write_pipeperi (uint16_t data) * Return value : PIPExCTR content ****************************************************************************/ -static uint16_t hw_usb_read_pipectr (uint16_t pipeno) +static uint16_t hw_usb_read_pipectr(uint16_t pipeno) { volatile uint16_t *p_reg; @@ -1694,7 +1694,7 @@ static uint16_t hw_usb_read_pipectr (uint16_t pipeno) p_reg = (uint16_t *)(RX65N_USB_PIPE1CTR + (pipeno - 1)); } - return (rx65n_usbhost_getreg (p_reg)); + return rx65n_usbhost_getreg(p_reg); } /**************************************************************************** @@ -1706,17 +1706,17 @@ static uint16_t hw_usb_read_pipectr (uint16_t pipeno) * Return value : none ****************************************************************************/ -void hw_usb_write_pipectr (uint16_t pipeno, uint16_t data) +void hw_usb_write_pipectr(uint16_t pipeno, uint16_t data) { volatile uint16_t *p_reg; if (USB_PIPE0 == pipeno) { - p_reg = (uint16_t *) RX65N_USB_DCPCTR; + p_reg = (uint16_t *)RX65N_USB_DCPCTR; } else { - p_reg = (uint16_t *) RX65N_USB_PIPE1CTR + (pipeno - 1); + p_reg = (uint16_t *)RX65N_USB_PIPE1CTR + (pipeno - 1); } *p_reg = data; @@ -1730,16 +1730,16 @@ void hw_usb_write_pipectr (uint16_t pipeno, uint16_t data) * Return value : none ****************************************************************************/ -static void hw_usb_set_aclrm (uint16_t pipeno) +static void hw_usb_set_aclrm(uint16_t pipeno) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; if (USB_PIPE0 == pipeno) { - p_reg = (uint16_t *) RX65N_USB_DCPCTR; + p_reg = (uint16_t *)RX65N_USB_DCPCTR; } else { - p_reg = (uint16_t *) RX65N_USB_PIPE1CTR + (pipeno - 1); + p_reg = (uint16_t *)RX65N_USB_PIPE1CTR + (pipeno - 1); } (*p_reg) |= RX65N_USB_PIPECTR_ACLRM; @@ -1755,16 +1755,16 @@ static void hw_usb_set_aclrm (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_clear_aclrm (uint16_t pipeno) +static void hw_usb_clear_aclrm(uint16_t pipeno) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; if (USB_PIPE0 == pipeno) { - p_reg = (uint16_t *) RX65N_USB_DCPCTR; + p_reg = (uint16_t *)RX65N_USB_DCPCTR; } else { - p_reg = (uint16_t *) RX65N_USB_PIPE1CTR + (pipeno - 1); + p_reg = (uint16_t *)RX65N_USB_PIPE1CTR + (pipeno - 1); } (*p_reg) &= (~RX65N_USB_PIPECTR_ACLRM); @@ -1779,16 +1779,16 @@ static void hw_usb_clear_aclrm (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_set_sqclr (uint16_t pipeno) +static void hw_usb_set_sqclr(uint16_t pipeno) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; if (USB_PIPE0 == pipeno) { - p_reg = (uint16_t *) RX65N_USB_DCPCTR; + p_reg = (uint16_t *)RX65N_USB_DCPCTR; } else { - p_reg = (uint16_t *) RX65N_USB_PIPE1CTR + (pipeno - 1); + p_reg = (uint16_t *)RX65N_USB_PIPE1CTR + (pipeno - 1); } (*p_reg) |= RX65N_USB_PIPECTR_SQCLR; @@ -1804,16 +1804,16 @@ static void hw_usb_set_sqclr (uint16_t pipeno) * Return value : none ****************************************************************************/ -void hw_usb_set_sqset (uint16_t pipeno) +void hw_usb_set_sqset(uint16_t pipeno) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; if (USB_PIPE0 == pipeno) { - p_reg = (uint16_t *) RX65N_USB_DCPCTR; + p_reg = (uint16_t *)RX65N_USB_DCPCTR; } else { - p_reg = (uint16_t *) RX65N_USB_PIPE1CTR + (pipeno - 1); + p_reg = (uint16_t *)RX65N_USB_PIPE1CTR + (pipeno - 1); } (*p_reg) |= RX65N_USB_PIPECTR_SQSET; @@ -1828,16 +1828,16 @@ void hw_usb_set_sqset (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_set_pid (uint16_t pipeno, uint16_t data) +static void hw_usb_set_pid(uint16_t pipeno, uint16_t data) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; if (USB_PIPE0 == pipeno) { - p_reg = (uint16_t *) RX65N_USB_DCPCTR; + p_reg = (uint16_t *)RX65N_USB_DCPCTR; } else { - p_reg = (uint16_t *) RX65N_USB_PIPE1CTR + (pipeno - 1); + p_reg = (uint16_t *)RX65N_USB_PIPE1CTR + (pipeno - 1); } (*p_reg) &= (~RX65N_USB_PIPECTR_PID_MASK); @@ -1853,16 +1853,16 @@ static void hw_usb_set_pid (uint16_t pipeno, uint16_t data) * Return value : none ****************************************************************************/ -static void hw_usb_clear_pid (uint16_t pipeno, uint16_t data) +static void hw_usb_clear_pid(uint16_t pipeno, uint16_t data) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; if (USB_PIPE0 == pipeno) { - p_reg = (uint16_t *) RX65N_USB_DCPCTR; + p_reg = (uint16_t *)RX65N_USB_DCPCTR; } else { - p_reg = (uint16_t *) RX65N_USB_PIPE1CTR + (pipeno - 1); + p_reg = (uint16_t *)RX65N_USB_PIPE1CTR + (pipeno - 1); } (*p_reg) &= (~RX65N_USB_PIPECTR_PID_MASK); @@ -1877,11 +1877,11 @@ static void hw_usb_clear_pid (uint16_t pipeno, uint16_t data) * Return value : none ****************************************************************************/ -static void hw_usb_set_trenb (uint16_t pipeno) +static void hw_usb_set_trenb(uint16_t pipeno) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; - p_reg = (uint16_t *) RX65N_USB_PIPE1TRE + ((pipeno - 1) * 2); + p_reg = (uint16_t *)RX65N_USB_PIPE1TRE + ((pipeno - 1) * 2); (*p_reg) |= RX65N_USB_PIPETRE_TRENB; } @@ -1895,11 +1895,11 @@ static void hw_usb_set_trenb (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_clear_trenb (uint16_t pipeno) +static void hw_usb_clear_trenb(uint16_t pipeno) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; - p_reg = (uint16_t *) RX65N_USB_PIPE1TRE + ((pipeno - 1) * 2); + p_reg = (uint16_t *)RX65N_USB_PIPE1TRE + ((pipeno - 1) * 2); (*p_reg) &= (~RX65N_USB_PIPETRE_TRENB); } @@ -1913,11 +1913,11 @@ static void hw_usb_clear_trenb (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_set_trclr (uint16_t pipeno) +static void hw_usb_set_trclr(uint16_t pipeno) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; - p_reg = (uint16_t *) RX65N_USB_PIPE1TRE + ((pipeno - 1) * 2); + p_reg = (uint16_t *)RX65N_USB_PIPE1TRE + ((pipeno - 1) * 2); (*p_reg) |= RX65N_USB_PIPETRE_TRCLR; } @@ -1930,11 +1930,11 @@ static void hw_usb_set_trclr (uint16_t pipeno) * Return value : none ****************************************************************************/ -static void hw_usb_write_pipetrn (uint16_t pipeno, uint16_t data) +static void hw_usb_write_pipetrn(uint16_t pipeno, uint16_t data) { - volatile uint16_t *p_reg; + volatile uint16_t *p_reg; - p_reg = (uint16_t *) RX65N_USB_PIPE1TRN + ((pipeno - 1) * 2); + p_reg = (uint16_t *)RX65N_USB_PIPE1TRN + ((pipeno - 1) * 2); *p_reg = data; } @@ -1946,7 +1946,7 @@ static void hw_usb_write_pipetrn (uint16_t pipeno, uint16_t data) * Return value : none ****************************************************************************/ -void usb_hstd_bchg_enable (void) +void usb_hstd_bchg_enable(void) { hw_usb_hclear_sts_bchg(); hw_usb_hset_enb_bchge(); @@ -1959,7 +1959,7 @@ void usb_hstd_bchg_enable (void) * Return value : none ****************************************************************************/ -void usb_hstd_bchg_disable (void) +void usb_hstd_bchg_disable(void) { hw_usb_hclear_sts_bchg(); hw_usb_hclear_enb_bchge(); @@ -1972,7 +1972,7 @@ void usb_hstd_bchg_disable (void) * Return value : none ****************************************************************************/ -void usb_hstd_set_uact (void) +void usb_hstd_set_uact(void) { hw_usb_rmw_dvstctr(RX65N_USB_DVSTCTR0_UACT, ((RX65N_USB_DVSTCTR0_USBRST | @@ -1988,7 +1988,7 @@ void usb_hstd_set_uact (void) * Return value : none ****************************************************************************/ -void usb_hstd_attch_enable (void) +void usb_hstd_attch_enable(void) { /* ATTCH status Clear */ @@ -2007,7 +2007,7 @@ void usb_hstd_attch_enable (void) * Return value : none ****************************************************************************/ -void usb_hstd_attch_disable (void) +void usb_hstd_attch_disable(void) { /* ATTCH Clear */ @@ -2026,7 +2026,7 @@ void usb_hstd_attch_disable (void) * Return value : none ****************************************************************************/ -void usb_hstd_dtch_enable (void) +void usb_hstd_dtch_enable(void) { /* DTCH Clear */ @@ -2045,7 +2045,7 @@ void usb_hstd_dtch_enable (void) * Return value : none ****************************************************************************/ -void usb_hstd_dtch_disable (void) +void usb_hstd_dtch_disable(void) { /* DTCH Clear */ @@ -2063,7 +2063,7 @@ void usb_hstd_dtch_disable (void) * Return value : none ****************************************************************************/ -void usb_hstd_berne_enable (void) +void usb_hstd_berne_enable(void) { /* Enable BEMP, NRDY, BRDY */ @@ -2081,7 +2081,7 @@ void usb_hstd_berne_enable (void) * Return value : none ****************************************************************************/ -void usb_hstd_do_sqtgl (uint16_t pipe, uint16_t toggle) +void usb_hstd_do_sqtgl(uint16_t pipe, uint16_t toggle) { if (USB_MAX_PIPE_NO < pipe) { @@ -2113,7 +2113,7 @@ void usb_hstd_do_sqtgl (uint16_t pipe, uint16_t toggle) * Return value : uint16_t end_flag ****************************************************************************/ -uint16_t usb_hstd_write_data_control_pipe (uint8_t * buf_add, +uint16_t usb_hstd_write_data_control_pipe(uint8_t * buf_add, size_t buf_size) { uint16_t size; @@ -2123,8 +2123,8 @@ uint16_t usb_hstd_write_data_control_pipe (uint8_t * buf_add, uint16_t end_flag; buffer = usb_cstd_is_set_frdy(USB_PIPE0, - (uint16_t) RX65N_USB_USING_CFIFO, - (uint16_t) RX65N_USB_CFIFOSEL_ISEL); + RX65N_USB_USING_CFIFO, + RX65N_USB_CFIFOSEL_ISEL); /* Check error */ @@ -2132,7 +2132,7 @@ uint16_t usb_hstd_write_data_control_pipe (uint8_t * buf_add, { /* FIFO access error */ - return (USB_FIFOERROR); + return USB_FIFOERROR; } /* Data buffer size */ @@ -2145,7 +2145,7 @@ uint16_t usb_hstd_write_data_control_pipe (uint8_t * buf_add, /* Data size check */ - if (buf_size <= (uint32_t) size) + if (buf_size <= (uint32_t)size) { count = buf_size; @@ -2209,7 +2209,7 @@ uint16_t usb_hstd_write_data_control_pipe (uint8_t * buf_add, * Return value : uint16_t end_flag ****************************************************************************/ -uint16_t usb_hstd_write_data (uint8_t * buf_add, size_t buf_size, +uint16_t usb_hstd_write_data(uint8_t *buf_add, size_t buf_size, uint16_t pipe, uint16_t pipemode) { uint16_t size; @@ -2225,7 +2225,7 @@ uint16_t pipe, uint16_t pipemode) /* Changes FIFO port by the pipe. */ - buffer = usb_cstd_is_set_frdy(pipe, (uint16_t) pipemode, USB_FALSE); + buffer = usb_cstd_is_set_frdy(pipe, pipemode, USB_FALSE); /* Check error */ @@ -2233,7 +2233,7 @@ uint16_t pipe, uint16_t pipemode) { /* FIFO access error */ - return (USB_FIFOERROR); + return USB_FIFOERROR; } /* Data buffer size */ @@ -2246,7 +2246,7 @@ uint16_t pipe, uint16_t pipemode) /* Data size check */ - if (buf_size <= (uint32_t) size) + if (buf_size <= (uint32_t)size) { count = buf_size; @@ -2312,7 +2312,7 @@ uint16_t pipe, uint16_t pipemode) * Return value : none ****************************************************************************/ -void usb_hstd_receive_start (uint8_t *buffer, size_t buflen, uint8_t pipe) +void usb_hstd_receive_start(uint8_t *buffer, size_t buflen, uint8_t pipe) { uint32_t length; uint16_t mxps; @@ -2329,10 +2329,10 @@ void usb_hstd_receive_start (uint8_t *buffer, size_t buflen, uint8_t pipe) /* Ignore count clear */ - hw_usb_clear_status_bemp((uint16_t) pipe); /* BEMP Status Clear */ - hw_usb_clear_sts_brdy(pipe); /* BRDY Status Clear */ - hw_usb_clear_status_nrdy (pipe); /* NRDY Status Clear */ - nrdy_retries[pipe] = 0; /* Initialize theh NRDY retries to 0 */ + hw_usb_clear_status_bemp(pipe); /* BEMP Status Clear */ + hw_usb_clear_sts_brdy(pipe); /* BRDY Status Clear */ + hw_usb_clear_status_nrdy(pipe); /* NRDY Status Clear */ + nrdy_retries[pipe] = 0; /* Initialize theh NRDY retries to 0 */ useport = USB_CUSE; /* Changes the FIFO port by the pipe. */ @@ -2342,22 +2342,21 @@ void usb_hstd_receive_start (uint8_t *buffer, size_t buflen, uint8_t pipe) length = buflen; - if ((uint32_t) 0u != length) + if (0u != length) { /* Data length check */ - if ((uint32_t) 0u == (length % mxps)) + if ((0u == (length % mxps)) { /* Set Transaction counter */ - usb_cstd_set_transaction_counter(pipe, (uint16_t) (length / mxps)); + usb_cstd_set_transaction_counter(pipe, length / mxps); } else { /* Set Transaction counter */ - usb_cstd_set_transaction_counter(pipe, (uint16_t) ((length / mxps) - + (uint32_t) 1u)); + usb_cstd_set_transaction_counter(pipe, length / mxps + 1u)); } } @@ -2380,7 +2379,7 @@ void usb_hstd_receive_start (uint8_t *buffer, size_t buflen, uint8_t pipe) * Return value : none ****************************************************************************/ -void usb_hstd_send_start (uint8_t *buffer, size_t buflen, uint8_t pipe) +void usb_hstd_send_start(uint8_t *buffer, size_t buflen, uint8_t pipe) { uint16_t useport; @@ -2392,7 +2391,7 @@ void usb_hstd_send_start (uint8_t *buffer, size_t buflen, uint8_t pipe) usb_cstd_set_nak(pipe); /* Select NAK */ hw_usb_clear_status_bemp(pipe); /* BEMP Status Clear */ hw_usb_clear_sts_brdy(pipe); /* BRDY Status Clear */ - hw_usb_clear_status_nrdy (pipe); /* NRDY Status Clear */ + hw_usb_clear_status_nrdy(pipe); /* NRDY Status Clear */ nrdy_retries[pipe] = 0; /* Initialize theh NRDY retries to 0 */ /* Pipe number to FIFO port select */ @@ -2417,7 +2416,7 @@ void usb_hstd_send_start (uint8_t *buffer, size_t buflen, uint8_t pipe) * Return value : Pipe no (USB_PIPE1->USB_PIPE9:OK, USB_NULL:Error) ****************************************************************************/ -uint8_t usb_hstd_get_pipe_no (uint8_t type, uint8_t dir) +uint8_t usb_hstd_get_pipe_no(uint8_t type, uint8_t dir) { uint8_t pipe_no = USB_NULL; uint16_t pipe; @@ -2478,7 +2477,7 @@ uint8_t usb_hstd_get_pipe_no (uint8_t type, uint8_t dir) * Return value : USB_READING / USB_READEND / USB_READSHRT / USB_READOVER ****************************************************************************/ -uint16_t usb_hstd_read_data_control_pipe (void) +uint16_t usb_hstd_read_data_control_pipe(void) { uint16_t count; uint16_t buffer; @@ -2488,17 +2487,17 @@ uint16_t usb_hstd_read_data_control_pipe (void) /* Changes FIFO port by the pipe. */ - buffer = usb_cstd_is_set_frdy(USB_PIPE0, (uint16_t) USB_CUSE, USB_FALSE); + buffer = usb_cstd_is_set_frdy(USB_PIPE0, USB_CUSE, USB_FALSE); if (USB_FIFOERROR == buffer) { /* FIFO access error */ - return (USB_FIFOERROR); - syslog (LOG_INFO, "FIFO ERROR"); + return USB_FIFOERROR; + syslog(LOG_INFO, "FIFO ERROR"); } - dtln = (uint16_t) (buffer & RX65N_USB_FIFOCTR_DTLN); + dtln = buffer & RX65N_USB_FIFOCTR_DTLN; /* Max Packet Size */ @@ -2559,7 +2558,7 @@ uint16_t usb_hstd_read_data_control_pipe (void) g_rx65n_tdlist[USB_PIPE0].ed->xfrinfo->xfrd += count; - return (end_flag); + return end_flag; } /**************************************************************************** @@ -2571,7 +2570,7 @@ uint16_t usb_hstd_read_data_control_pipe (void) * Return value : USB_READING / USB_READEND / USB_READSHRT / USB_READOVER ****************************************************************************/ -uint16_t usb_hstd_read_data (uint16_t pipe, uint16_t pipemode) +uint16_t usb_hstd_read_data(uint16_t pipe, uint16_t pipemode) { uint16_t count; uint16_t buffer; @@ -2586,14 +2585,14 @@ uint16_t usb_hstd_read_data (uint16_t pipe, uint16_t pipemode) if (pipe != 0) /* Data transfer for non CTRL pipe */ { - buffer = usb_cstd_is_set_frdy(pipe, (uint16_t) pipemode, USB_FALSE); + buffer = usb_cstd_is_set_frdy(pipe, pipemode, USB_FALSE); if (USB_FIFOERROR == buffer) { - return (USB_FIFOERROR); + return USB_FIFOERROR; } - dtln = (uint16_t) (buffer & RX65N_USB_FIFOCTR_DTLN); + dtln = buffer & RX65N_USB_FIFOCTR_DTLN; mxps = usb_cstd_get_maxpacket_size(pipe); /* now calculate the count */ @@ -2656,7 +2655,7 @@ uint16_t usb_hstd_read_data (uint16_t pipe, uint16_t pipemode) } } - return (end_flag); + return end_flag; } /**************************************************************************** @@ -2669,7 +2668,7 @@ uint16_t usb_hstd_read_data (uint16_t pipe, uint16_t pipemode) * Return value : none ****************************************************************************/ -void usb_hstd_data_end (uint16_t pipe, uint16_t status) +void usb_hstd_data_end(uint16_t pipe, uint16_t status) { if (USB_MAX_PIPE_NO < pipe) { @@ -2710,8 +2709,8 @@ void usb_hstd_data_end (uint16_t pipe, uint16_t status) * Return value : none ****************************************************************************/ -void usb_hstd_buf_to_fifo (uint8_t *buffer, size_t buflen, uint16_t pipe, - uint16_t useport) +void usb_hstd_buf_to_fifo(uint8_t *buffer, size_t buflen, uint16_t pipe, + uint16_t useport) { uint16_t end_flag; @@ -2729,7 +2728,7 @@ void usb_hstd_buf_to_fifo (uint8_t *buffer, size_t buflen, uint16_t pipe, switch (end_flag) { - case USB_WRITING : + case USB_WRITING: /* Enable Ready Interrupt */ @@ -2741,13 +2740,13 @@ void usb_hstd_buf_to_fifo (uint8_t *buffer, size_t buflen, uint16_t pipe, break; - case USB_WRITEEND : + case USB_WRITEEND: /* End of data write */ /* continue */ - case USB_WRITESHRT : + case USB_WRITESHRT: /* End of data write */ @@ -2761,16 +2760,16 @@ void usb_hstd_buf_to_fifo (uint8_t *buffer, size_t buflen, uint16_t pipe, break; - case USB_FIFOERROR : + case USB_FIFOERROR: /* FIFO access error */ - syslog (LOG_INFO, "### FIFO access error\n"); - usb_hstd_forced_termination(pipe, (uint16_t) USB_DATA_ERR); + syslog(LOG_INFO, "### FIFO access error\n"); + usb_hstd_forced_termination(pipe, USB_DATA_ERR); break; - default : - usb_hstd_forced_termination(pipe, (uint16_t) USB_DATA_ERR); + default: + usb_hstd_forced_termination(pipe, USB_DATA_ERR); break; } } @@ -2784,7 +2783,7 @@ void usb_hstd_buf_to_fifo (uint8_t *buffer, size_t buflen, uint16_t pipe, * Return value : none ****************************************************************************/ -void usb_hstd_brdy_pipe_process (uint16_t bitsts) +void usb_hstd_brdy_pipe_process(uint16_t bitsts) { uint16_t i; uint16_t end_flag; @@ -2801,8 +2800,8 @@ void usb_hstd_brdy_pipe_process (uint16_t bitsts) { /* Clear the Interrupt status bit - clear for both BEMP and BRDY */ - hw_usb_clear_sts_brdy (i); - hw_usb_clear_status_bemp (i); + hw_usb_clear_sts_brdy(i); + hw_usb_clear_status_bemp(i); if (RX65N_USB_PIPECFG_DIR == usb_cstd_get_pipe_dir(i)) { /* Buffer to FIFO data write */ @@ -2816,16 +2815,15 @@ void usb_hstd_brdy_pipe_process (uint16_t bitsts) if (RX65N_USB_DCPCTR_PIDSTALL == (buffer & RX65N_USB_DCPCTR_PIDSTALL)) { - syslog (LOG_INFO, "### STALL Pipe %d\n", i); - usb_hstd_forced_termination(i, - (uint16_t) USB_DATA_STALL); + syslog(LOG_INFO, "### STALL Pipe %d\n", i); + usb_hstd_forced_termination(i, USB_DATA_STALL); } else { if (data_len == 0) { - syslog (LOG_INFO, "BRDY can NOT be with 0 len\ - data for pipe\n", i); + syslog(LOG_INFO, "BRDY can NOT be with 0 len\ + data for pipe\n", i); } /* If still data is present - let the data @@ -2862,7 +2860,7 @@ void usb_hstd_brdy_pipe_process (uint16_t bitsts) else { - usb_hstd_data_end(i, (uint16_t) USB_DATA_OK); + usb_hstd_data_end(i, USB_DATA_OK); g_rx65n_edlist[i].xfrinfo->tdstatus = TD_CC_NOERROR; @@ -2870,8 +2868,7 @@ void usb_hstd_brdy_pipe_process (uint16_t bitsts) if ((g_rx65n_edlist[i].xfrinfo != 0) && (g_rx65n_edlist[i].xfrinfo->callback)) { - hw_usb_write_dcpmxps((uint16_t) (USB_DEFPACKET - + USB_DEVICE_1)); + hw_usb_write_dcpmxps(USB_DEFPACKET + USB_DEVICE_1); rx65n_usbhost_asynch_completion(priv, &g_rx65n_edlist[i]); } @@ -2897,7 +2894,7 @@ void usb_hstd_brdy_pipe_process (uint16_t bitsts) * Return value : none ****************************************************************************/ -void usb_hstd_nrdy_pipe_process (uint16_t bitsts) +void usb_hstd_nrdy_pipe_process(uint16_t bitsts) { uint16_t i; @@ -2907,7 +2904,7 @@ void usb_hstd_nrdy_pipe_process (uint16_t bitsts) { if (0 != (bitsts & USB_BITSET(i))) { - hw_usb_clear_status_nrdy (i); + hw_usb_clear_status_nrdy(i); usb_hstd_nrdy_endprocess(i); } } @@ -2923,7 +2920,7 @@ void usb_hstd_nrdy_pipe_process (uint16_t bitsts) * Return value : none ****************************************************************************/ -void usb_hstd_bemp_pipe_process (uint16_t bitsts) +void usb_hstd_bemp_pipe_process(uint16_t bitsts) { uint16_t buffer; uint16_t i; @@ -2937,8 +2934,8 @@ void usb_hstd_bemp_pipe_process (uint16_t bitsts) { /* Clear the Interrupt status bit */ - hw_usb_clear_status_bemp (i); - hw_usb_clear_sts_brdy (i); + hw_usb_clear_status_bemp(i); + hw_usb_clear_sts_brdy(i); data_len = g_rx65n_edlist[i].xfrinfo->buflen - g_rx65n_edlist[i].xfrinfo->xfrd; @@ -2949,14 +2946,14 @@ void usb_hstd_bemp_pipe_process (uint16_t bitsts) if (RX65N_USB_DCPCTR_PIDSTALL == (buffer & RX65N_USB_DCPCTR_PIDSTALL)) { - syslog (LOG_INFO, "### STALL Pipe %d\n", i); - usb_hstd_forced_termination(i, (uint16_t) USB_DATA_STALL); + syslog(LOG_INFO, "### STALL Pipe %d\n", i); + usb_hstd_forced_termination(i, USB_DATA_STALL); } else { if (data_len == 0) { - usb_hstd_data_end(i, (uint16_t) USB_DATA_OK); + usb_hstd_data_end(i, USB_DATA_OK); g_rx65n_edlist[i].xfrinfo->tdstatus = TD_CC_NOERROR; /* Release the semaphore for this pipe */ @@ -2966,8 +2963,9 @@ void usb_hstd_bemp_pipe_process (uint16_t bitsts) else { - syslog (LOG_INFO, "BEMP can NOT be with %d len data \ - for pipe\n", data_len, i); + syslog(LOG_INFO, + "BEMP can NOT be with %d len data for pipe\n", + data_len, i); } } } @@ -2983,7 +2981,7 @@ void usb_hstd_bemp_pipe_process (uint16_t bitsts) * Return value : Value for set PIPEPERI ****************************************************************************/ -uint16_t usb_hstd_get_pipe_peri_value (uint8_t binterval) +uint16_t usb_hstd_get_pipe_peri_value(uint8_t binterval) { uint16_t pipe_peri = USB_NULL; uint16_t work1; @@ -3005,14 +3003,14 @@ uint16_t usb_hstd_get_pipe_peri_value (uint8_t binterval) work2 = 0; for (; work1 != 0; work2++ ) { - work1 = (uint16_t)(work1 >> 1); + work1 >>= 1; } if (0 != work2) { /* Interval time */ - pipe_peri |= (uint16_t)(work2 - 1); + pipe_peri |= (work2 - 1); } } @@ -3029,12 +3027,12 @@ uint16_t usb_hstd_get_pipe_peri_value (uint8_t binterval) * Note : Please change for your SYSTEM ****************************************************************************/ -uint16_t usb_hstd_chk_attach (void) +uint16_t usb_hstd_chk_attach(void) { uint16_t buf[3]; usb_hstd_read_lnst(buf); - if (0 == (uint16_t) (buf[1] & RX65N_USB_DVSTCTR0_RHST)) + if (0 == (buf[1] & RX65N_USB_DVSTCTR0_RHST)) { if (RX65N_USB_SYSSTS0_LNST_FS_JSTS == (buf[0] & 3)) { @@ -3050,16 +3048,16 @@ uint16_t usb_hstd_chk_attach (void) } else if (RX65N_USB_SYSSTS0_LNST_SE0 == (buf[0] & 3)) { - syslog (LOG_INFO, "Debug: Detach device\n"); + syslog(LOG_INFO, "Debug: Detach device\n"); } else { - syslog (LOG_INFO, "Attach unknown speed device\n"); + syslog(LOG_INFO, "Attach unknown speed device\n"); } } else { - syslog (LOG_INFO, "Already device attached\n"); + syslog(LOG_INFO, "Already device attached\n"); return 0; } @@ -3075,7 +3073,7 @@ uint16_t usb_hstd_chk_attach (void) * Return value : none ****************************************************************************/ -void usb_hstd_chk_clk (uint16_t event) +void usb_hstd_chk_clk(uint16_t event) { if ((USB_DETACH == event) || (USB_SUSPEND == event)) { @@ -3097,7 +3095,7 @@ void usb_hstd_chk_clk (uint16_t event) * Return value : Device speed ****************************************************************************/ -uint16_t usb_hstd_detach_process (void) +uint16_t usb_hstd_detach_process(void) { uint16_t connect_inf; uint16_t i; @@ -3117,7 +3115,7 @@ uint16_t usb_hstd_detach_process (void) { /* End of data transfer (IN/OUT) */ - usb_hstd_forced_termination(USB_PIPE0, (uint16_t) USB_DATA_STOP); + usb_hstd_forced_termination(USB_PIPE0, USB_DATA_STOP); } usb_cstd_clr_pipe_cnfg(USB_PIPE0); @@ -3138,7 +3136,7 @@ uint16_t usb_hstd_detach_process (void) { /* End of data transfer (IN/OUT) */ - usb_hstd_forced_termination(i, (uint16_t) USB_DATA_STOP); + usb_hstd_forced_termination(i, USB_DATA_STOP); } usb_cstd_clr_pipe_cnfg(i); @@ -3150,15 +3148,15 @@ uint16_t usb_hstd_detach_process (void) connect_inf = usb_hstd_chk_attach(); switch (connect_inf) { - case USB_ATTACHL : + case USB_ATTACHL: usb_hstd_attach(connect_inf); break; - case USB_ATTACHF : + case USB_ATTACHF: usb_hstd_attach(connect_inf); break; - case USB_DETACH : + case USB_DETACH: /* USB detach */ @@ -3166,10 +3164,10 @@ uint16_t usb_hstd_detach_process (void) /* Check clock */ - usb_hstd_chk_clk((uint16_t) USB_DETACH); + usb_hstd_chk_clk(USB_DETACH); break; - default : + default: /* USB detach */ @@ -3177,7 +3175,7 @@ uint16_t usb_hstd_detach_process (void) /* Check clock */ - usb_hstd_chk_clk((uint16_t) USB_DETACH); + usb_hstd_chk_clk(USB_DETACH); break; } @@ -3196,7 +3194,7 @@ uint16_t usb_hstd_detach_process (void) * Note : Please change for your SYSTEM ****************************************************************************/ -void usb_hstd_read_lnst (uint16_t *buf) +void usb_hstd_read_lnst(uint16_t *buf) { /* WAIT_LOOP */ @@ -3259,7 +3257,7 @@ void usb_hstd_read_lnst (uint16_t *buf) * Note : Please change for your SYSTEM ****************************************************************************/ -uint16_t usb_hstd_attach_process (void) +uint16_t usb_hstd_attach_process(void) { uint16_t connect_inf; @@ -3277,15 +3275,15 @@ uint16_t usb_hstd_attach_process (void) connect_inf = usb_hstd_chk_attach(); switch (connect_inf) { - case USB_ATTACHL : + case USB_ATTACHL: usb_hstd_attach(connect_inf); break; - case USB_ATTACHF : + case USB_ATTACHF: usb_hstd_attach(connect_inf); break; - case USB_DETACH : + case USB_DETACH: /* USB detach */ @@ -3293,11 +3291,11 @@ uint16_t usb_hstd_attach_process (void) /* Check clock */ - usb_hstd_chk_clk((uint16_t) USB_DETACH); + usb_hstd_chk_clk(USB_DETACH); break; - default : - usb_hstd_attach((uint16_t) USB_ATTACHF); + default: + usb_hstd_attach(USB_ATTACHF); break; } @@ -3311,7 +3309,7 @@ uint16_t usb_hstd_attach_process (void) * Return value : none ****************************************************************************/ -void usb_hstd_chk_sof (void) +void usb_hstd_chk_sof(void) { up_mdelay(1); } @@ -3323,7 +3321,7 @@ void usb_hstd_chk_sof (void) * Return value : none ****************************************************************************/ -void usb_hstd_bus_reset (void) +void usb_hstd_bus_reset(void) { uint16_t buf; uint16_t i; @@ -3335,7 +3333,7 @@ void usb_hstd_bus_reset (void) /* Wait 50ms */ - up_mdelay(50); /* usb_cpu_delay_xms((uint16_t) 50); */ + up_mdelay(50); /* usb_cpu_delay_xms(50); */ /* USBRST=0, RESUME=0, UACT=1 */ @@ -3343,7 +3341,7 @@ void usb_hstd_bus_reset (void) /* Wait 10ms or more (USB reset recovery) */ - up_mdelay(20); /* usb_cpu_delay_xms((uint16_t) 20); */ + up_mdelay(20); /* usb_cpu_delay_xms(20); */ /* WAIT_LOOP */ @@ -3355,8 +3353,7 @@ void usb_hstd_bus_reset (void) { /* DeviceStateControlRegister - ResetHandshakeStatusCheck */ - buf = hw_usb_read_dvstctr(); - buf = (uint16_t) (buf & RX65N_USB_DVSTCTR0_RHST); + buf = hw_usb_read_dvstctr() & RX65N_USB_DVSTCTR0_RHST; if (0x04 == buf) { /* Wait */ @@ -3379,25 +3376,25 @@ void usb_hstd_bus_reset (void) * Return value : The incremented address of last argument (write_p). ****************************************************************************/ -uint8_t *usb_hstd_write_fifo (uint16_t count, uint16_t pipemode, +uint8_t *usb_hstd_write_fifo(uint16_t count, uint16_t pipemode, uint8_t *write_p) { uint16_t even; { /* WAIT_LOOP */ - for (even = (uint16_t) (count >> 1); (0 != even); --even) + for (even = count >> 1; 0 != even; --even) { /* 16bit access */ - hw_usb_write_fifo16(pipemode, *((uint16_t *) write_p)); + hw_usb_write_fifo16(pipemode, *((uint16_t *)write_p)); /* Renewal write pointer */ write_p += sizeof(uint16_t); } - if ((count & (uint16_t) 0x0001u) != 0u) + if ((count & 0x0001u) != 0u) { /* count == odd */ @@ -3433,7 +3430,7 @@ uint8_t *usb_hstd_write_fifo (uint16_t count, uint16_t pipemode, * : next. ****************************************************************************/ -uint8_t *usb_hstd_read_fifo (uint16_t count, uint16_t pipemode, +uint8_t *usb_hstd_read_fifo(uint16_t count, uint16_t pipemode, uint8_t *read_p) { uint16_t even; @@ -3441,18 +3438,18 @@ uint8_t *usb_hstd_read_fifo (uint16_t count, uint16_t pipemode, /* WAIT_LOOP */ - for (even = (uint16_t) (count >> 1); (0 != even); --even) + for (even = count >> 1; 0 != even; --even) { /* 16bit FIFO access */ - *(uint16_t *) read_p = hw_usb_read_fifo16(pipemode); + *(uint16_t *)read_p = hw_usb_read_fifo16(pipemode); /* Renewal read pointer */ read_p += sizeof(uint16_t); } - if ((count & (uint16_t) 0x0001) != 0) + if ((count & 0x0001) != 0) { /* 16bit FIFO access */ @@ -3480,7 +3477,7 @@ uint8_t *usb_hstd_read_fifo (uint16_t count, uint16_t pipemode, * : back. ****************************************************************************/ -void usb_hstd_forced_termination (uint16_t pipe, uint16_t status) +void usb_hstd_forced_termination(uint16_t pipe, uint16_t status) { uint16_t buffer; @@ -3511,8 +3508,7 @@ void usb_hstd_forced_termination (uint16_t pipe, uint16_t status) { /* Changes the FIFO port by the pipe. */ - usb_cstd_chg_curpipe((uint16_t) USB_PIPE0, - (uint16_t) USB_CUSE, USB_FALSE); + usb_cstd_chg_curpipe(USB_PIPE0, USB_CUSE, USB_FALSE); } #ifdef DMA_DTC_NOT_ENABLED @@ -3525,8 +3521,7 @@ void usb_hstd_forced_termination (uint16_t pipe, uint16_t status) { /* Changes the FIFO port by the pipe. */ - usb_cstd_chg_curpipe(ptr, (uint16_t) USB_PIPE0, - (uint16_t) USB_D0USE, USB_FALSE); + usb_cstd_chg_curpipe(ptr, USB_PIPE0, USB_D0USE, USB_FALSE); } /* Clear D1FIFO-port */ @@ -3536,8 +3531,7 @@ void usb_hstd_forced_termination (uint16_t pipe, uint16_t status) { /* Changes the FIFO port by the pipe. */ - usb_cstd_chg_curpipe(ptr, (uint16_t) USB_PIPE0, - (uint16_t) USB_D1USE, USB_FALSE); + usb_cstd_chg_curpipe(ptr, USB_PIPE0, USB_D1USE, USB_FALSE); } #endif /* ((USB_CFG_DTC==USB_CFG_ENABLE)||(USB_CFG_DMA==USB_CFG_ENABLE)) */ @@ -3557,7 +3551,7 @@ void usb_hstd_forced_termination (uint16_t pipe, uint16_t status) * Note : none ****************************************************************************/ -void usb_hstd_nrdy_endprocess (uint16_t pipe) +void usb_hstd_nrdy_endprocess(uint16_t pipe) { uint16_t buffer; @@ -3603,13 +3597,13 @@ void usb_hstd_nrdy_endprocess (uint16_t pipe) /* PIPEx Data Retry */ - usb_hstd_data_end(pipe, (uint16_t) USB_DATA_TMO); + usb_hstd_data_end(pipe, USB_DATA_TMO); hw_usb_set_bclr(USB_CUSE); /* Clear Buffer on CPU side */ g_rx65n_edlist[pipe].xfrinfo->tdstatus = TD_CC_DEVNOTRESPONDING; /* 5ms wait */ - usb_cstd_pipe_init (pipe); + usb_cstd_pipe_init(pipe); /* Release the semaphore for this pipe */ @@ -3625,7 +3619,7 @@ void usb_hstd_nrdy_endprocess (uint16_t pipe) * Return : none ****************************************************************************/ -void usb_hstd_bus_int_disable (void) +void usb_hstd_bus_int_disable(void) { /* ATTCH interrupt disable */ @@ -3649,7 +3643,7 @@ void usb_hstd_bus_int_disable (void) * Return value : none ****************************************************************************/ -void usb_hstd_attach (uint16_t result) +void usb_hstd_attach(uint16_t result) { /* DTCH interrupt enable */ @@ -3670,14 +3664,14 @@ void usb_hstd_attach (uint16_t result) * Return value : none ****************************************************************************/ -void usb_hstd_detach (void) +void usb_hstd_detach(void) { /* DVSTCTR clear */ - hw_usb_clear_dvstctr((uint16_t) (RX65N_USB_DVSTCTR0_RWUPE | - RX65N_USB_DVSTCTR0_USBRST | - RX65N_USB_DVSTCTR0_RESUME | - RX65N_USB_DVSTCTR0_UACT)); + hw_usb_clear_dvstctr(RX65N_USB_DVSTCTR0_RWUPE | + RX65N_USB_DVSTCTR0_USBRST | + RX65N_USB_DVSTCTR0_RESUME | + RX65N_USB_DVSTCTR0_UACT); /* ATTCH interrupt enable */ @@ -3692,7 +3686,7 @@ void usb_hstd_detach (void) * Return value : uint16_t : FIFO buffer size or max packet size. ****************************************************************************/ -static uint16_t usb_cstd_get_buf_size (uint16_t pipe) +static uint16_t usb_cstd_get_buf_size(uint16_t pipe) { uint16_t size = 0; uint16_t buffer; @@ -3705,7 +3699,7 @@ static uint16_t usb_cstd_get_buf_size (uint16_t pipe) /* Max Packet Size */ - size = (uint16_t) (buffer & RX65N_USB_DCPMAXP_MXPS_MASK); + size = buffer & RX65N_USB_DCPMAXP_MXPS_MASK; } else { @@ -3715,11 +3709,11 @@ static uint16_t usb_cstd_get_buf_size (uint16_t pipe) /* Read the maximum packet size of selected pipe */ - buffer = hw_usb_read_pipemaxp (); + buffer = hw_usb_read_pipemaxp(); /* Max Packet Size */ - size = (uint16_t) (buffer & RX65N_USB_PIPEMAXP_MXPSMASK); + size = buffer & RX65N_USB_PIPEMAXP_MXPSMASK; } return size; @@ -3733,7 +3727,7 @@ static uint16_t usb_cstd_get_buf_size (uint16_t pipe) * Return value : none ****************************************************************************/ -static void usb_cstd_pipe_init (uint16_t pipe) +static void usb_cstd_pipe_init(uint16_t pipe) { /* Interrupt Disable */ @@ -3799,7 +3793,7 @@ static void usb_cstd_pipe_init (uint16_t pipe) * Return value : none ****************************************************************************/ -static void usb_cstd_clr_pipe_cnfg (uint16_t pipe_no) +static void usb_cstd_clr_pipe_cnfg(uint16_t pipe_no) { /* PID=NAK & clear STALL */ @@ -3821,8 +3815,7 @@ static void usb_cstd_clr_pipe_cnfg (uint16_t pipe_no) /* PIPE Configuration */ - usb_cstd_chg_curpipe((uint16_t) USB_PIPE0, - (uint16_t) USB_CUSE, USB_FALSE); + usb_cstd_chg_curpipe(USB_PIPE0, USB_CUSE, USB_FALSE); hw_usb_write_pipesel(pipe_no); hw_usb_write_pipecfg(0); @@ -3864,7 +3857,7 @@ static void usb_cstd_clr_pipe_cnfg (uint16_t pipe_no) * Return value : none ****************************************************************************/ -static void usb_cstd_set_nak (uint16_t pipe) +static void usb_cstd_set_nak(uint16_t pipe) { uint16_t buf; uint16_t n; @@ -3887,7 +3880,7 @@ static void usb_cstd_set_nak (uint16_t pipe) /* PIPE control reg read */ buf = hw_usb_read_pipectr(pipe); - if (0 == (uint16_t) (buf & RX65N_USB_DCPCTR_PID_MASK)) + if (0 == (buf & RX65N_USB_DCPCTR_PID_MASK)) { n = 0xfffeu; } @@ -3903,8 +3896,8 @@ static void usb_cstd_set_nak (uint16_t pipe) * Return value : FRDY status ****************************************************************************/ -static uint16_t usb_cstd_is_set_frdy (uint16_t pipe, uint16_t fifosel, - uint16_t isel) +static uint16_t usb_cstd_is_set_frdy(uint16_t pipe, uint16_t fifosel, + uint16_t isel) { uint16_t buffer; uint16_t i; @@ -3919,10 +3912,10 @@ static uint16_t usb_cstd_is_set_frdy (uint16_t pipe, uint16_t fifosel, { buffer = hw_usb_read_fifoctr(fifosel); - if (RX65N_USB_FIFOCTR_FRDY == (uint16_t) (buffer & + if (RX65N_USB_FIFOCTR_FRDY == (buffer & RX65N_USB_FIFOCTR_FRDY)) { - return (buffer); + return buffer; } buffer = hw_usb_read_syscfg(); @@ -3930,7 +3923,7 @@ static uint16_t usb_cstd_is_set_frdy (uint16_t pipe, uint16_t fifosel, nxsig_usleep(1); } - return (RX65N_USB_FIFO_ERROR); + return RX65N_USB_FIFO_ERROR; } /**************************************************************************** @@ -3943,7 +3936,7 @@ static uint16_t usb_cstd_is_set_frdy (uint16_t pipe, uint16_t fifosel, * Return value : none ****************************************************************************/ -void usb_cstd_chg_curpipe (uint16_t pipe, uint16_t fifosel, uint16_t isel) +void usb_cstd_chg_curpipe(uint16_t pipe, uint16_t fifosel, uint16_t isel) { uint16_t buffer; @@ -3953,7 +3946,7 @@ void usb_cstd_chg_curpipe (uint16_t pipe, uint16_t fifosel, uint16_t isel) { /* CFIFO use */ - case RX65N_USB_USING_CFIFO : + case RX65N_USB_USING_CFIFO: /* ISEL=1, CURPIPE=0 */ @@ -3967,8 +3960,7 @@ void usb_cstd_chg_curpipe (uint16_t pipe, uint16_t fifosel, uint16_t isel) buffer = hw_usb_read_fifosel(USB_CUSE); } - while ((buffer & (uint16_t) (USB_ISEL | USB_CURPIPE)) != - (uint16_t) (isel | pipe)); + while ((buffer & (USB_ISEL | USB_CURPIPE)) != (isel | pipe)); break; #ifdef DTC_DMA_ENABLED @@ -3976,29 +3968,29 @@ void usb_cstd_chg_curpipe (uint16_t pipe, uint16_t fifosel, uint16_t isel) /* D0FIFO use */ - case USB_D0USE : + case USB_D0USE: /* D1FIFO use */ - case USB_D1USE : + case USB_D1USE: /* DxFIFO pipe select */ - hw_usb_set_curpipe (fifosel, pipe); + hw_usb_set_curpipe(fifosel, pipe); /* WAIT_LOOP */ do { - buffer = hw_usb_read_fifosel (fifosel); + buffer = hw_usb_read_fifosel(fifosel); } - while ((uint16_t)(buffer & USB_CURPIPE) != pipe); + while ((buffer & USB_CURPIPE) != pipe); break; #endif /* ((USB_CFG_DTC==USB_CFG_ENABLE||(USB_CFG_DMA==USB_CFG_ENABLE))*/ #endif /* DTC_DMA_ENABLED */ - default : + default: break; } } @@ -4011,8 +4003,8 @@ void usb_cstd_chg_curpipe (uint16_t pipe, uint16_t fifosel, uint16_t isel) * Return value : none ****************************************************************************/ -static void usb_cstd_set_transaction_counter (uint16_t trnreg, - uint16_t trncnt) +static void usb_cstd_set_transaction_counter(uint16_t trnreg, + uint16_t trncnt) { hw_usb_set_trclr(trnreg); hw_usb_write_pipetrn(trnreg, trncnt); @@ -4026,7 +4018,7 @@ static void usb_cstd_set_transaction_counter (uint16_t trnreg, * Return value : none ****************************************************************************/ -static void usb_cstd_clr_transaction_counter (uint16_t trnreg) +static void usb_cstd_clr_transaction_counter(uint16_t trnreg) { hw_usb_clear_trenb(trnreg); hw_usb_set_trclr(trnreg); @@ -4039,7 +4031,7 @@ static void usb_cstd_clr_transaction_counter (uint16_t trnreg) * Return value : none ****************************************************************************/ -static void usb_cstd_nrdy_enable (uint16_t pipe) +static void usb_cstd_nrdy_enable(uint16_t pipe) { if (USB_MAX_PIPE_NO < pipe) { @@ -4058,7 +4050,7 @@ static void usb_cstd_nrdy_enable (uint16_t pipe) * Return value : uint16_t PID-bit status ****************************************************************************/ -static uint16_t usb_cstd_get_pid (uint16_t pipe) +static uint16_t usb_cstd_get_pid(uint16_t pipe) { uint16_t buf; @@ -4070,7 +4062,7 @@ static uint16_t usb_cstd_get_pid (uint16_t pipe) /* PIPE control reg read */ buf = hw_usb_read_pipectr(pipe); - return (uint16_t) (buf & RX65N_USB_DCPCTR_PID_MASK); + return buf & RX65N_USB_DCPCTR_PID_MASK; } /**************************************************************************** @@ -4080,7 +4072,7 @@ static uint16_t usb_cstd_get_pid (uint16_t pipe) * Return value : uint16_t MaxPacketSize ****************************************************************************/ -static uint16_t usb_cstd_get_maxpacket_size (uint16_t pipe) +static uint16_t usb_cstd_get_maxpacket_size(uint16_t pipe) { uint16_t size; uint16_t buffer; @@ -4104,7 +4096,7 @@ static uint16_t usb_cstd_get_maxpacket_size (uint16_t pipe) /* Max Packet Size */ - size = (uint16_t) (buffer & RX65N_USB_DCPMAXP_MXPS_MASK); + size = (buffer & RX65N_USB_DCPMAXP_MXPS_MASK); return size; } @@ -4116,7 +4108,7 @@ static uint16_t usb_cstd_get_maxpacket_size (uint16_t pipe) * Return value : uint16_t pipe direction. ****************************************************************************/ -static uint16_t usb_cstd_get_pipe_dir (uint16_t pipe) +static uint16_t usb_cstd_get_pipe_dir(uint16_t pipe) { uint16_t buffer; @@ -4132,7 +4124,7 @@ static uint16_t usb_cstd_get_pipe_dir (uint16_t pipe) /* Read Pipe direction */ buffer = hw_usb_read_pipecfg(); - return (uint16_t) (buffer & RX65N_USB_PIPECFG_DIR); + return buffer & RX65N_USB_PIPECFG_DIR; } /**************************************************************************** @@ -4143,7 +4135,7 @@ static uint16_t usb_cstd_get_pipe_dir (uint16_t pipe) * Return value : none ****************************************************************************/ -static void usb_cstd_do_aclrm (uint16_t pipe) +static void usb_cstd_do_aclrm(uint16_t pipe) { if (USB_MAX_PIPE_NO < pipe) { @@ -4163,7 +4155,7 @@ static void usb_cstd_do_aclrm (uint16_t pipe) * Return value : none ****************************************************************************/ -static void usb_cstd_set_buf (uint16_t pipe) +static void usb_cstd_set_buf(uint16_t pipe) { if (USB_MAX_PIPE_NO < pipe) { @@ -4185,7 +4177,7 @@ static void usb_cstd_set_buf (uint16_t pipe) * Note : PID is set to NAK. ****************************************************************************/ -static void usb_cstd_clr_stall (uint16_t pipe) +static void usb_cstd_clr_stall(uint16_t pipe) { if (USB_MAX_PIPE_NO < pipe) { @@ -4210,13 +4202,13 @@ static void usb_cstd_clr_stall (uint16_t pipe) * : : USB_WRITESHRT / USB_FIFOERROR ****************************************************************************/ -uint16_t usb_hstd_ctrl_write_start (uint8_t * buf_add, size_t buf_size) +uint16_t usb_hstd_ctrl_write_start(uint8_t *buf_add, size_t buf_size) { uint16_t end_flag; /* PID=NAK & clear STALL */ - usb_cstd_clr_stall((uint16_t) USB_PIPE0); + usb_cstd_clr_stall(USB_PIPE0); /* DCP Configuration Register (0x5c) */ @@ -4226,64 +4218,64 @@ uint16_t usb_hstd_ctrl_write_start (uint8_t * buf_add, size_t buf_size) hw_usb_clear_status_bemp(USB_PIPE0); - end_flag = usb_hstd_write_data_control_pipe (buf_add, buf_size); + end_flag = usb_hstd_write_data_control_pipe(buf_add, buf_size); switch (end_flag) { /* End of data write */ - case USB_WRITESHRT : + case USB_WRITESHRT: /* Next stage is Control write status stage */ /* Enable Empty Interrupt */ - hw_usb_set_bempenb((uint16_t) USB_PIPE0); + hw_usb_set_bempenb(USB_PIPE0); /* Enable Not Ready Interrupt */ - usb_cstd_nrdy_enable((uint16_t) USB_PIPE0); + usb_cstd_nrdy_enable(USB_PIPE0); /* Set BUF */ - usb_cstd_set_buf((uint16_t) USB_PIPE0); + usb_cstd_set_buf(USB_PIPE0); break; /* End of data write (not null) */ - case USB_WRITEEND : + case USB_WRITEEND: /* continue */ /* Continue of data write */ - case USB_WRITING : + case USB_WRITING: /* Enable Empty Interrupt */ - hw_usb_set_bempenb((uint16_t) USB_PIPE0); + hw_usb_set_bempenb(USB_PIPE0); /* Enable Not Ready Interrupt */ - usb_cstd_nrdy_enable((uint16_t) USB_PIPE0); + usb_cstd_nrdy_enable(USB_PIPE0); /* Set BUF */ - usb_cstd_set_buf((uint16_t) USB_PIPE0); + usb_cstd_set_buf(USB_PIPE0); break; /* FIFO access error */ - case USB_FIFOERROR : + case USB_FIFOERROR: break; - default : + default: break; } /* End or Err or Continue */ - return (end_flag); + return end_flag; } /**************************************************************************** @@ -4293,11 +4285,11 @@ uint16_t usb_hstd_ctrl_write_start (uint8_t * buf_add, size_t buf_size) * Return : none ****************************************************************************/ -void usb_hstd_ctrl_read_start (void) +void usb_hstd_ctrl_read_start(void) { /* PID=NAK & clear STALL */ - usb_cstd_clr_stall((uint16_t) USB_PIPE0); + usb_cstd_clr_stall(USB_PIPE0); /* DCP Configuration Register (0x5c) */ @@ -4311,30 +4303,30 @@ void usb_hstd_ctrl_read_start (void) /* Enable Ready Interrupt */ - hw_usb_set_brdyenb((uint16_t) USB_PIPE0); + hw_usb_set_brdyenb(USB_PIPE0); /* Enable Not Ready Interrupt */ - usb_cstd_nrdy_enable((uint16_t) USB_PIPE0); - usb_cstd_set_buf((uint16_t) USB_PIPE0); /* Set BUF */ + usb_cstd_nrdy_enable(USB_PIPE0); + usb_cstd_set_buf(USB_PIPE0); /* Set BUF */ } /**************************************************************************** * Function Name : usb_host_read_pipe_start * Description : Start data stage of data Read transfer. - * Arguments : uint32_t Bsize : Data Size - * : uint8_t *Table : Data Table Address + * Arguments : uint32_t Bsize : Data Size + * : uint8_t *Table : Data Table Address * Return : none ****************************************************************************/ -void usb_host_read_pipe_start (uint16_t pipe) +void usb_host_read_pipe_start(uint16_t pipe) { uint16_t config_reg; uint16_t ctrl_reg; /* PID=NAK & clear STALL */ - usb_cstd_clr_stall((uint16_t) pipe); + usb_cstd_clr_stall(pipe); config_reg = hw_usb_read_pipecfg(); @@ -4345,11 +4337,11 @@ void usb_host_read_pipe_start (uint16_t pipe) /* Set the direction as read */ config_reg = config_reg & ~(RX65N_USB_PIPECFG_DIR); - hw_usb_write_pipecfg (config_reg); + hw_usb_write_pipecfg(config_reg); ctrl_reg = hw_usb_read_pipectr (pipe); ctrl_reg = ctrl_reg | RX65N_USB_PIPECTR_SQSET; - hw_usb_write_pipectr (pipe, ctrl_reg); + hw_usb_write_pipectr(pipe, ctrl_reg); /* usb_hstd_do_sqtgl((uint16_t) USB_PIPE0, 0); */ @@ -4357,15 +4349,15 @@ void usb_host_read_pipe_start (uint16_t pipe) /* Enable Ready Interrupt */ - hw_usb_set_brdyenb((uint16_t) pipe); + hw_usb_set_brdyenb(pipe); /* Enable Not Ready Interrupt */ - usb_cstd_nrdy_enable((uint16_t) pipe); + usb_cstd_nrdy_enable(pipe); /* Set BUF */ - usb_cstd_set_buf((uint16_t) pipe); + usb_cstd_set_buf(pipe); } /**************************************************************************** @@ -4374,17 +4366,17 @@ void usb_host_read_pipe_start (uint16_t pipe) * Arguments : none ****************************************************************************/ -void usb_hstd_status_start (void) +void usb_hstd_status_start(void) { /* Interrupt Disable */ /* BEMP0 Disable */ - hw_usb_clear_bempenb((uint16_t) USB_PIPE0); + hw_usb_clear_bempenb(USB_PIPE0); /* BRDY0 Disable */ - hw_usb_clear_brdyenb((uint16_t) USB_PIPE0); + hw_usb_clear_brdyenb(USB_PIPE0); } /**************************************************************************** @@ -4395,28 +4387,26 @@ void usb_hstd_status_start (void) * Return : none ****************************************************************************/ -void usb_hstd_ctrl_end (uint16_t status) +void usb_hstd_ctrl_end(uint16_t status) { /* Interrupt Disable */ - hw_usb_clear_bempenb((uint16_t) USB_PIPE0); /* BEMP0 Disable */ - hw_usb_clear_brdyenb((uint16_t) USB_PIPE0); /* BRDY0 Disable */ - hw_usb_clear_nrdyenb((uint16_t) USB_PIPE0); /* NRDY0 Disable */ + hw_usb_clear_bempenb(USB_PIPE0); /* BEMP0 Disable */ + hw_usb_clear_brdyenb(USB_PIPE0); /* BRDY0 Disable */ + hw_usb_clear_nrdyenb(USB_PIPE0); /* NRDY0 Disable */ - usb_cstd_clr_stall((uint16_t) USB_PIPE0); /* PID=NAK & clear STALL */ + usb_cstd_clr_stall(USB_PIPE0); /* PID=NAK & clear STALL */ hw_usb_set_mbw(USB_CUSE, USB0_CFIFO_MBW); /* SUREQ=1, SQCLR=1, PID=NAK */ - hw_usb_hwrite_dcpctr((uint16_t) (USB_SUREQCLR | USB_SQCLR)); + hw_usb_hwrite_dcpctr((USB_SUREQCLR | USB_SQCLR); /* CFIFO buffer clear */ - usb_cstd_chg_curpipe((uint16_t) USB_PIPE0, - (uint16_t) USB_CUSE, USB_FALSE); + usb_cstd_chg_curpipe(USB_PIPE0, USB_CUSE, USB_FALSE); hw_usb_set_bclr(USB_CUSE); /* Clear BVAL */ - usb_cstd_chg_curpipe((uint16_t) USB_PIPE0, - (uint16_t) USB_CUSE, (uint16_t) USB_ISEL); + usb_cstd_chg_curpipe((USB_PIPE0, USB_CUSE, USB_ISEL); hw_usb_set_bclr(USB_CUSE); /* Clear BVAL */ } @@ -4427,11 +4417,11 @@ void usb_hstd_ctrl_end (uint16_t status) * Return value : none ****************************************************************************/ -void usb_hstd_brdy_pipe (void) +void usb_hstd_brdy_pipe(void) { uint16_t bitsts; - bitsts = rx65n_usbhost_getreg (RX65N_USB_BRDYSTS); + bitsts = rx65n_usbhost_getreg(RX65N_USB_BRDYSTS); /* When operating by the host function, usb_hstd_brdy_pipe() is executed * without fail because only one BRDY message is issued even when the @@ -4440,7 +4430,7 @@ void usb_hstd_brdy_pipe (void) if (USB_BRDY0 == (bitsts & USB_BRDY0)) { - hw_usb_clear_sts_brdy (USB_PIPE0); + hw_usb_clear_sts_brdy(USB_PIPE0); /* Branch by the Control transfer stage management */ @@ -4454,7 +4444,7 @@ void usb_hstd_brdy_pipe (void) /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_CTRL_END); + usb_hstd_ctrl_end(USB_CTRL_END); nxsem_post(&EDCTRL->wdhsem); return; /* Nothing else to do here... as of now... */ @@ -4464,25 +4454,25 @@ void usb_hstd_brdy_pipe (void) { /* Data stage of Control read transfer */ - case USB_DATARD : + case USB_DATARD: EDCTRL->xfrinfo->tdxfercond = usb_hstd_read_data_control_pipe (); switch (EDCTRL->xfrinfo->tdxfercond) { /* End of data read */ - case USB_READEND : + case USB_READEND: /* continue */ /* End of data read */ - case USB_READSHRT : + case USB_READSHRT: usb_hstd_status_start(); break; - case USB_READING : /* Continue of data read */ + case USB_READING: /* Continue of data read */ /* Still data is there - so set the condition for * reading in next interrupt... @@ -4491,47 +4481,47 @@ void usb_hstd_brdy_pipe (void) EDCTRL->xfrinfo->tdxfercond = USB_DATARD; break; - case USB_READOVER : /* FIFO access error */ + case USB_READOVER: /* FIFO access error */ /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_DATA_OVR); + usb_hstd_ctrl_end(USB_DATA_OVR); break; - case USB_FIFOERROR : /* FIFO access error */ + case USB_FIFOERROR: /* FIFO access error */ /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_DATA_ERR); + usb_hstd_ctrl_end(USB_DATA_ERR); syslog(LOG_INFO, "ERROR"); break; - default : + default: break; } break; /* Data stage of Control read transfer */ - case USB_DATARDCNT : + case USB_DATARDCNT: - switch (usb_hstd_read_data_control_pipe ()) + switch (usb_hstd_read_data_control_pipe()) { - case USB_READEND : /* End of data read */ + case USB_READEND: /* End of data read */ /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_CTRL_READING); + usb_hstd_ctrl_end(USB_CTRL_READING); break; - case USB_READSHRT : /* End of data read */ + case USB_READSHRT: /* End of data read */ /* Control Read/Write Status */ usb_hstd_status_start(); break; - case USB_READING : /* Continue of data read */ + case USB_READING: /* Continue of data read */ /* Still data is there - so set the condition for * reading in next interrupt... @@ -4540,47 +4530,47 @@ void usb_hstd_brdy_pipe (void) EDCTRL->xfrinfo->tdxfercond = USB_DATARDCNT; break; - case USB_READOVER : /* FIFO access error */ + case USB_READOVER: /* FIFO access error */ /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_DATA_OVR); + usb_hstd_ctrl_end(USB_DATA_OVR); break; - case USB_FIFOERROR : /* FIFO access error */ + case USB_FIFOERROR: /* FIFO access error */ /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_DATA_ERR); + usb_hstd_ctrl_end(USB_DATA_ERR); syslog(LOG_INFO, "ERROR"); break; - default : + default: break; } break; /* Status stage Control write (NoData control) transfer */ - case USB_STATUSWR : + case USB_STATUSWR: /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_CTRL_END); + usb_hstd_ctrl_end(USB_CTRL_END); break; - default : + default: break; } if ((EDCTRL->xfrinfo->tdxfercond == USB_READEND) || - (EDCTRL->xfrinfo->tdxfercond == USB_READSHRT) || - (EDCTRL->xfrinfo->tdxfercond == USB_READOVER)) + (EDCTRL->xfrinfo->tdxfercond == USB_READSHRT) || + (EDCTRL->xfrinfo->tdxfercond == USB_READOVER)) { nxsem_post(&EDCTRL->wdhsem); } - hw_usb_clear_sts_brdy (USB_PIPE0); /* This was missing? */ + hw_usb_clear_sts_brdy(USB_PIPE0); /* This was missing? */ } /* BRDY interrupt */ @@ -4596,12 +4586,12 @@ void usb_hstd_brdy_pipe (void) * Return value : none ****************************************************************************/ -void usb_hstd_nrdy_pipe (void) +void usb_hstd_nrdy_pipe(void) { uint16_t buffer; uint16_t bitsts; - bitsts = rx65n_usbhost_getreg (RX65N_USB_NRDYSTS); /* ptr->status; */ + bitsts = rx65n_usbhost_getreg(RX65N_USB_NRDYSTS); /* ptr->status; */ /* When operating by the host function, usb_hstd_nrdy_pipe() * is executed without fail because @@ -4611,11 +4601,11 @@ void usb_hstd_nrdy_pipe (void) if (USB_NRDY0 == (bitsts & USB_NRDY0)) { - hw_usb_clear_status_nrdy (USB_PIPE0); + hw_usb_clear_status_nrdy(USB_PIPE0); /* Get Pipe PID from pipe number */ - buffer = usb_cstd_get_pid((uint16_t) USB_PIPE0); + buffer = usb_cstd_get_pid(USB_PIPE0); /* STALL ? */ @@ -4624,13 +4614,13 @@ void usb_hstd_nrdy_pipe (void) { /* PIPE0 STALL call back */ - usb_hstd_ctrl_end((uint16_t) USB_DATA_STALL); + usb_hstd_ctrl_end(USB_DATA_STALL); } else { /* Control Data Stage Device Ignore X 3 call back */ - usb_hstd_ctrl_end((uint16_t) USB_DATA_ERR); + usb_hstd_ctrl_end(USB_DATA_ERR); } } @@ -4646,12 +4636,12 @@ void usb_hstd_nrdy_pipe (void) * Return value : none ****************************************************************************/ -void usb_hstd_bemp_pipe (void) +void usb_hstd_bemp_pipe(void) { uint16_t buffer; uint16_t bitsts; - bitsts = rx65n_usbhost_getreg (RX65N_USB_BEMPSTS); /* ptr->status; */ + bitsts = rx65n_usbhost_getreg(RX65N_USB_BEMPSTS); /* ptr->status; */ /* When operating by the host function, usb_hstd_bemp_pipe() * is executed without fail because @@ -4661,7 +4651,7 @@ void usb_hstd_bemp_pipe (void) if (USB_BEMP0 == (bitsts & USB_BEMP0)) { - hw_usb_clear_status_bemp (USB_PIPE0); + hw_usb_clear_status_bemp(USB_PIPE0); if (EDCTRL->xfrinfo->tdxfercond == USB_STATUSWR) { /* This interrupt occurred due to setup packet status @@ -4670,17 +4660,17 @@ void usb_hstd_bemp_pipe (void) /* BEMP0 Disable */ - hw_usb_clear_bempenb((uint16_t) USB_PIPE0); + hw_usb_clear_bempenb(USB_PIPE0); /* BRDY0 Disable */ - hw_usb_clear_brdyenb((uint16_t) USB_PIPE0); + hw_usb_clear_brdyenb(USB_PIPE0); /* Call this to end the setup packet */ /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_CTRL_END); + usb_hstd_ctrl_end(USB_CTRL_END); nxsem_post(&EDCTRL->wdhsem); return; /* As of now, Nothing else to do here... */ @@ -4688,7 +4678,7 @@ void usb_hstd_bemp_pipe (void) /* Get Pipe PID from pipe number */ - buffer = usb_cstd_get_pid((uint16_t) USB_PIPE0); + buffer = usb_cstd_get_pid(USB_PIPE0); /* MAX packet size error ? */ @@ -4696,7 +4686,7 @@ void usb_hstd_bemp_pipe (void) { /* PIPE0 STALL call back */ - usb_hstd_ctrl_end((uint16_t) USB_DATA_STALL); + usb_hstd_ctrl_end(USB_DATA_STALL); } else { @@ -4706,129 +4696,129 @@ void usb_hstd_bemp_pipe (void) { /* Continuas of data stage (Control write) */ - case USB_DATAWR : + case USB_DATAWR: /* We should not get into this... */ /* Buffer to CFIFO data write */ - switch (usb_hstd_write_data_control_pipe (0, 0)) + switch (usb_hstd_write_data_control_pipe(0, 0)) { /* End of data write */ - case USB_WRITESHRT : + case USB_WRITESHRT: - hw_usb_set_bempenb((uint16_t) USB_PIPE0); + hw_usb_set_bempenb(USB_PIPE0); /* Enable Not Ready Interrupt */ - usb_cstd_nrdy_enable((uint16_t) USB_PIPE0); + usb_cstd_nrdy_enable(USB_PIPE0); break; /* End of data write (not null) */ - case USB_WRITEEND : + case USB_WRITEEND: /* continue */ /* Continue of data write */ - case USB_WRITING : + case USB_WRITING: /* Enable Empty Interrupt */ - hw_usb_set_bempenb((uint16_t) USB_PIPE0); + hw_usb_set_bempenb(USB_PIPE0); /* Enable Not Ready Interrupt */ - usb_cstd_nrdy_enable((uint16_t) USB_PIPE0); + usb_cstd_nrdy_enable(USB_PIPE0); break; /* FIFO access error */ - case USB_FIFOERROR : + case USB_FIFOERROR: /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_DATA_ERR); + usb_hstd_ctrl_end(USB_DATA_ERR); break; - default : + default: break; } break; /* Next stage to Control write data */ - case USB_DATAWRCNT : + case USB_DATAWRCNT: /* Buffer to CFIFO data write */ /* We should not get here... */ - switch (usb_hstd_write_data_control_pipe (0, 0)) + switch (usb_hstd_write_data_control_pipe(0, 0)) { /* End of data write */ - case USB_WRITESHRT : + case USB_WRITESHRT: - hw_usb_set_bempenb((uint16_t) USB_PIPE0); + hw_usb_set_bempenb(USB_PIPE0); /* Enable Not Ready Interrupt */ - usb_cstd_nrdy_enable((uint16_t) USB_PIPE0); + usb_cstd_nrdy_enable(USB_PIPE0); break; /* End of data write (not null) */ - case USB_WRITEEND : + case USB_WRITEEND: /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_CTRL_WRITING); + usb_hstd_ctrl_end(USB_CTRL_WRITING); break; /* Continue of data write */ - case USB_WRITING : + case USB_WRITING: /* Enable Empty Interrupt */ - hw_usb_set_bempenb((uint16_t) USB_PIPE0); + hw_usb_set_bempenb(USB_PIPE0); /* Enable Not Ready Interrupt */ - usb_cstd_nrdy_enable((uint16_t) USB_PIPE0); + usb_cstd_nrdy_enable(USB_PIPE0); break; /* FIFO access error */ - case USB_FIFOERROR : + case USB_FIFOERROR: /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_DATA_ERR); + usb_hstd_ctrl_end(USB_DATA_ERR); break; - default : + default: break; } break; - case USB_STATUSWR : /* End of data stage (Control write) */ + case USB_STATUSWR: /* End of data stage (Control write) */ usb_hstd_status_start(); break; /* Status stage of Control read transfer */ - case USB_STATUSRD : + case USB_STATUSRD: /* Control Read/Write End */ - usb_hstd_ctrl_end((uint16_t) USB_CTRL_END); + usb_hstd_ctrl_end(USB_CTRL_END); break; - default : + default: break; } } @@ -4969,7 +4959,7 @@ static void rx65n_usbhost_putreg(uint16_t val, uint32_t addr) static inline uint16_t rx65n_usbhost_getle16(const uint8_t *val) { - return (uint16_t)val[1] << 8 | (uint16_t)val[0]; + return val[1] << 8 | val[0]; } /**************************************************************************** @@ -5202,7 +5192,7 @@ static void rx65n_usbhost_free_xfrinfo(struct ****************************************************************************/ static inline int rx65n_usbhost_addctrled(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed) + struct rx65n_usbhost_ed_s *ed) { /* Ctrl ED is always used and statically assigned */ @@ -5218,7 +5208,7 @@ static inline int rx65n_usbhost_addctrled(struct rx65n_usbhost_s *priv, ****************************************************************************/ static inline int rx65n_usbhost_remctrled(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed) + struct rx65n_usbhost_ed_s *ed) { /* Ctrl ED is always used and statically assigned */ @@ -5242,13 +5232,13 @@ static inline int rx65n_usbhost_remctrled(struct rx65n_usbhost_s *priv, static inline int rx65n_usbhost_addbulked(struct rx65n_usbhost_s *priv, const struct usbhost_epdesc_s *epdesc, - struct rx65n_usbhost_ed_s *ed) + struct rx65n_usbhost_ed_s *ed) { #ifndef CONFIG_USBHOST_BULK_DISABLE irqstate_t flags; - uint8_t pipe_no; - uint16_t pipe_cfg; - uint16_t pipe_maxp; + uint8_t pipe_no; + uint16_t pipe_cfg; + uint16_t pipe_maxp; /* Pipe Cycle Control Register is not needed for bulk pipe */ @@ -5295,7 +5285,7 @@ static inline int rx65n_usbhost_addbulked(struct rx65n_usbhost_s *priv, /* Now update these values in the requried pipe */ - usb_cstd_pipe_init (pipe_no); + usb_cstd_pipe_init(pipe_no); leave_critical_section(flags); return OK; @@ -5314,7 +5304,7 @@ static inline int rx65n_usbhost_addbulked(struct rx65n_usbhost_s *priv, ****************************************************************************/ static inline int rx65n_usbhost_rembulked(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed) + struct rx65n_usbhost_ed_s *ed) { /* This function requires implementation * for OHCI specific interrupt disabling @@ -5333,7 +5323,7 @@ static inline int rx65n_usbhost_rembulked(struct rx65n_usbhost_s *priv, * ****************************************************************************/ -#if !defined(CONFIG_USBHOST_INT_DISABLE) || \ +#if !defined(CONFIG_USBHOST_INT_DISABLE) || \ !defined(CONFIG_USBHOST_ISOC_DISABLE) static unsigned int rx65n_usbhost_getinterval(uint8_t interval) { @@ -5509,7 +5499,7 @@ static inline int rx65n_usbhost_addinted(struct rx65n_usbhost_s *priv, /* Now get the Pipe Peri values */ - pipe_peri = usb_hstd_get_pipe_peri_value (epdesc->interval); + pipe_peri = usb_hstd_get_pipe_peri_value(epdesc->interval); /* Now all the values are ready to be written */ @@ -5519,7 +5509,7 @@ static inline int rx65n_usbhost_addinted(struct rx65n_usbhost_s *priv, /* Now update these values in the requried pipe */ - usb_cstd_pipe_init (pipe_no); + usb_cstd_pipe_init(pipe_no); struct rx65n_usbhost_xfrinfo_s *xfrinfo; DEBUGASSERT(ed->xfrinfo == NULL); @@ -5545,7 +5535,7 @@ static inline int rx65n_usbhost_addinted(struct rx65n_usbhost_s *priv, /* Now start the interrupt pipe */ - usb_host_read_pipe_start (pipe_no); + usb_host_read_pipe_start(pipe_no); /* Get the head of the first of the duplicated entries. The first offset * entry is always guaranteed to contain the common ED list head. @@ -5594,7 +5584,7 @@ static inline int rx65n_usbhost_addinted(struct rx65n_usbhost_s *priv, ****************************************************************************/ static inline int rx65n_usbhost_reminted(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed) + struct rx65n_usbhost_ed_s *ed) { /* This function is to disable OHCI specific interrupts * As, RX65N is not OHCI compliant, this function does not require @@ -5631,7 +5621,7 @@ static inline int rx65n_usbhost_addisoced(struct rx65n_usbhost_s *priv, ****************************************************************************/ static inline int rx65n_usbhost_remisoced(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed) + struct rx65n_usbhost_ed_s *ed) { #ifndef CONFIG_USBHOST_ISOC_DISABLE printf("Isochronous endpoints not yet supported\n"); @@ -5649,9 +5639,9 @@ static inline int rx65n_usbhost_remisoced(struct rx65n_usbhost_s *priv, ****************************************************************************/ static int rx65n_usbhost_enqueuetd(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed, uint32_t dirpid, - uint32_t toggle, volatile uint8_t *buffer, - size_t buflen) + struct rx65n_usbhost_ed_s *ed, + uint32_t dirpid, uint32_t toggle, + volatile uint8_t *buffer, size_t buflen) { struct rx65n_usbhost_gtd_s *td; int ret = -ENOMEM; @@ -5706,7 +5696,7 @@ static int rx65n_usbhost_enqueuetd(struct rx65n_usbhost_s *priv, ****************************************************************************/ static int rx65n_usbhost_wdhwait(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed) + struct rx65n_usbhost_ed_s *ed) { struct rx65n_usbhost_xfrinfo_s *xfrinfo; irqstate_t flags = enter_critical_section(); @@ -5747,8 +5737,9 @@ static int rx65n_usbhost_wdhwait(struct rx65n_usbhost_s *priv, ****************************************************************************/ static int rx65n_usbhost_ctrltd(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed, - uint32_t dirpid, uint8_t *buffer, size_t buflen) + struct rx65n_usbhost_ed_s *ed, + uint32_t dirpid, uint8_t *buffer, + size_t buflen) { struct rx65n_usbhost_xfrinfo_s *xfrinfo; uint32_t toggle; @@ -5824,24 +5815,24 @@ static int rx65n_usbhost_ctrltd(struct rx65n_usbhost_s *priv, /* Set DATA0 bit of DCPCTR */ - rx65n_usbhost_setbit (RX65N_USB_DCPCTR, RX65N_USB_DCPCTR_SQCLR); + rx65n_usbhost_setbit(RX65N_USB_DCPCTR, RX65N_USB_DCPCTR_SQCLR); sdata = *(ed->xfrinfo->buffer) | (*(ed->xfrinfo->buffer + 1) << 8); /* Request type and Request */ - rx65n_usbhost_putreg (sdata, RX65N_USB_USBREQ); + rx65n_usbhost_putreg(sdata, RX65N_USB_USBREQ); sdata = *(ed->xfrinfo->buffer + 2) | (*(ed->xfrinfo->buffer + 3) << 8); - rx65n_usbhost_putreg (sdata, RX65N_USB_USBVAL); /* wValue */ + rx65n_usbhost_putreg(sdata, RX65N_USB_USBVAL); /* wValue */ sdata = *(ed->xfrinfo->buffer + 4) | (*(ed->xfrinfo->buffer + 5) << 8); - rx65n_usbhost_putreg (sdata, RX65N_USB_USBINDX); /* wIndex */ + rx65n_usbhost_putreg(sdata, RX65N_USB_USBINDX); /* wIndex */ sdata = *(ed->xfrinfo->buffer + 6) | (*(ed->xfrinfo->buffer + 7) << 8); - rx65n_usbhost_putreg (sdata, RX65N_USB_USBLENG); /* wLen */ + rx65n_usbhost_putreg(sdata, RX65N_USB_USBLENG); /* wLen */ - rx65n_usbhost_setbit (RX65N_USB_DCPCTR, RX65N_USB_DCPCTR_SQSET); + rx65n_usbhost_setbit(RX65N_USB_DCPCTR, RX65N_USB_DCPCTR_SQSET); hw_usb_hclear_sts_sign(); hw_usb_hclear_sts_sack(); @@ -5866,7 +5857,7 @@ static int rx65n_usbhost_ctrltd(struct rx65n_usbhost_s *priv, /* Disable setup packet status response */ - rx65n_usbhost_clearbit (RX65N_USB_INTENB1, + rx65n_usbhost_clearbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_SACKE | RX65N_USB_INTENB1_SIGNE); } @@ -5876,11 +5867,11 @@ static int rx65n_usbhost_ctrltd(struct rx65n_usbhost_s *priv, /* BEMP0 Disable */ - hw_usb_clear_bempenb((uint16_t) USB_PIPE0); + hw_usb_clear_bempenb(USB_PIPE0); /* BRDY0 Disable */ - hw_usb_clear_brdyenb((uint16_t) USB_PIPE0); + hw_usb_clear_brdyenb(USB_PIPE0); usb_hstd_ctrl_read_start(); @@ -5913,11 +5904,11 @@ static int rx65n_usbhost_ctrltd(struct rx65n_usbhost_s *priv, /* Disable Empty Interrupt */ - hw_usb_clear_bempenb((uint16_t) USB_PIPE0); + hw_usb_clear_bempenb(USB_PIPE0); /* Disable Not Ready Interrupt */ - hw_usb_clear_nrdyenb((uint16_t) USB_PIPE0); + hw_usb_clear_nrdyenb(USB_PIPE0); } /* Check the TD completion status bits */ @@ -5962,10 +5953,10 @@ static int rx65n_usbhost_usbinterrupt(int irq, void *context, FAR void *arg) /* Read Interrupt Status and mask out interrupts that are not enabled. */ - intenb0 = rx65n_usbhost_getreg (RX65N_USB_INTENB0); - intenb1 = rx65n_usbhost_getreg (RX65N_USB_INTENB1); - intsts0 = rx65n_usbhost_getreg (RX65N_USB_INTSTS0); - intsts1 = rx65n_usbhost_getreg (RX65N_USB_INTSTS1); + intenb0 = rx65n_usbhost_getreg(RX65N_USB_INTENB0); + intenb1 = rx65n_usbhost_getreg(RX65N_USB_INTENB1); + intsts0 = rx65n_usbhost_getreg(RX65N_USB_INTSTS0); + intsts1 = rx65n_usbhost_getreg(RX65N_USB_INTSTS1); if ((((intsts1 & intenb1) & RX65N_USB_INTSTS1_SACK)) == RX65N_USB_INTSTS1_SACK) @@ -5974,7 +5965,7 @@ static int rx65n_usbhost_usbinterrupt(int irq, void *context, FAR void *arg) /* Disable setup packet status response */ - rx65n_usbhost_clearbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_SACKE | + rx65n_usbhost_clearbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_SACKE | RX65N_USB_INTENB1_SIGNE); /* release the EP0 ep->wdhsem semaphore */ @@ -5995,7 +5986,7 @@ static int rx65n_usbhost_usbinterrupt(int irq, void *context, FAR void *arg) /* Disable setup packet status response */ - rx65n_usbhost_clearbit (RX65N_USB_INTENB1, RX65N_USB_INTENB1_SACKE | + rx65n_usbhost_clearbit(RX65N_USB_INTENB1, RX65N_USB_INTENB1_SACKE | RX65N_USB_INTENB1_SIGNE); DEBUGASSERT(work_available(&g_usbhost.rx65n_interrupt_bhalf)); @@ -6009,7 +6000,7 @@ static int rx65n_usbhost_usbinterrupt(int irq, void *context, FAR void *arg) else if ((((intsts1 & intenb1) & RX65N_USB_INTSTS1_EOFERR)) == RX65N_USB_INTSTS1_EOFERR) { - rx65n_usbhost_putreg (((~RX65N_USB_INTSTS1_EOFERR) & + rx65n_usbhost_putreg(((~RX65N_USB_INTSTS1_EOFERR) & INTSTS1_BIT_VALUES_TO_ACK), RX65N_USB_INTSTS1); } @@ -6023,7 +6014,7 @@ static int rx65n_usbhost_usbinterrupt(int irq, void *context, FAR void *arg) /* Acknowledge the OVRCR interrupt */ - rx65n_usbhost_putreg (ack_interrupt, RX65N_USB_INTSTS1); + rx65n_usbhost_putreg(ack_interrupt, RX65N_USB_INTSTS1); } /* Check for attach condition... */ @@ -6120,16 +6111,16 @@ static int rx65n_usbhost_usbinterrupt(int irq, void *context, FAR void *arg) else if ((((intsts0 & intenb0) & RX65N_USB_INTSTS0_VBINT)) == RX65N_USB_INTSTS0_VBINT) { - rx65n_usbhost_clearbit (RX65N_USB_INTSTS0, RX65N_USB_INTSTS0_VBINT); + rx65n_usbhost_clearbit(RX65N_USB_INTSTS0, RX65N_USB_INTSTS0_VBINT); } /* If none of the interrupt - what happens? */ else { - syslog (LOG_INFO, "Unhandled interrupt. INTENB0 = 0x%x, \ - INTENB1 = 0x%x, INTSTS0 = 0x%x and INTSTS1 = 0x%x\n", - intenb0, intenb1, intsts0, intsts1); + syslog(LOG_INFO, "Unhandled interrupt. INTENB0 = 0x%x, \ + INTENB1 = 0x%x, INTSTS0 = 0x%x and INTSTS1 = 0x%x\n", + intenb0, intenb1, intsts0, intsts1); } return OK; @@ -6145,7 +6136,7 @@ static int rx65n_usbhost_usbinterrupt(int irq, void *context, FAR void *arg) * FIT driver ****************************************************************************/ -static void rx65n_usbhost_bottomhalf (void *arg) +static void rx65n_usbhost_bottomhalf(void *arg) { struct rx65n_usbhost_s *priv = &g_usbhost; uint32_t bottom_half_processing = (uint32_t)arg; @@ -6181,14 +6172,14 @@ static void rx65n_usbhost_bottomhalf (void *arg) else if (bottom_half_processing == USB_PROCESS_ATTACHED_INT) { g_attached = true; - device_speed = usb_hstd_attach_process (); + device_speed = usb_hstd_attach_process(); if (!priv->connected) { /* Yes.. connected. */ connected_times++; - syslog (LOG_INFO, "NuttX: USB Device Connected. %d\n", - connected_times); + syslog(LOG_INFO, "NuttX: USB Device Connected. %d\n", + connected_times); priv->connected = true; priv->change = true; @@ -6213,7 +6204,7 @@ static void rx65n_usbhost_bottomhalf (void *arg) } else { - syslog (LOG_INFO, "WARNING: Spurious status change (connected)\n"); + syslog(LOG_INFO, "WARNING: Spurious status change (connected)\n"); } g_attached = false; @@ -6222,14 +6213,14 @@ static void rx65n_usbhost_bottomhalf (void *arg) else if (bottom_half_processing == USB_PROCESS_DETACHED_INT) { g_detached = true; - device_speed = usb_hstd_detach_process (); + device_speed = usb_hstd_detach_process(); if (priv->connected) { /* Yes.. disconnect the device */ - syslog (LOG_INFO, "NuttX: USB Device Disconnected. %d\n", - connected_times); + syslog(LOG_INFO, "NuttX: USB Device Disconnected. %d\n", + connected_times); priv->connected = false; priv->change = true; @@ -6267,8 +6258,8 @@ static void rx65n_usbhost_bottomhalf (void *arg) } else { - syslog (LOG_INFO, "WARNING: Spurious status change \ - (disconnected)\n"); + syslog(LOG_INFO, "WARNING: Spurious status change \ + (disconnected)\n"); } g_detached = false; @@ -6298,7 +6289,7 @@ static void rx65n_usbhost_bottomhalf (void *arg) nxsig_usleep(100); uwarn("WARNING: un known bottomhalf. Value is %d\n", bottom_half_processing); - syslog (LOG_INFO, "WARNING: un known bottomhalf. Value is %d\n", + syslog(LOG_INFO, "WARNING: un known bottomhalf. Value is %d\n", bottom_half_processing); } @@ -6335,7 +6326,7 @@ static void rx65n_usbhost_bottomhalf (void *arg) ****************************************************************************/ static int rx65n_usbhost_wait(struct usbhost_connection_s *conn, - struct usbhost_hubport_s **hport) + struct usbhost_hubport_s **hport) { struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)&g_usbhost; struct usbhost_hubport_s *connport; @@ -6433,7 +6424,7 @@ static int rx65n_usbhost_wait(struct usbhost_connection_s *conn, ****************************************************************************/ static int rx65n_usbhost_rh_enumerate(struct usbhost_connection_s *conn, - struct usbhost_hubport_s *hport) + struct usbhost_hubport_s *hport) { struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)&g_usbhost; DEBUGASSERT(conn != NULL && hport != NULL && hport->port == 0); @@ -6492,7 +6483,7 @@ static int rx65n_usbhost_rh_enumerate(struct usbhost_connection_s *conn, ****************************************************************************/ static int rx65n_usbhost_enumerate(FAR struct usbhost_connection_s *conn, - FAR struct usbhost_hubport_s *hport) + FAR struct usbhost_hubport_s *hport) { int ret; @@ -6522,12 +6513,12 @@ static int rx65n_usbhost_enumerate(FAR struct usbhost_connection_s *conn, if (ret < 0) { uerr("ERROR: Enumeration failed: %d\n", ret); - syslog (LOG_INFO, "ERROR: Enumeration failed: %d\n", ret); + syslog(LOG_INFO, "ERROR: Enumeration failed: %d\n", ret); } else { - syslog (LOG_INFO, "Root Hub Port device enumerated"); + syslog(LOG_INFO, "Root Hub Port device enumerated"); } return ret; @@ -6580,22 +6571,22 @@ static int rx65n_usbhost_ep0configure(struct usbhost_driver_s *drvr, /* if (funcaddr == 0) */ - hw_usb_hset_usbspd (funcaddr, (speed << 6)); + hw_usb_hset_usbspd(funcaddr, (speed << 6)); /* else * hw_usb_hset_usbspd (funcaddr, (1 << 6)); * debug_ptr = RX65N_USB_DEVADD0+funcaddr; */ - current_dcpmaxp = hw_usb_read_dcpmaxp (); + current_dcpmaxp = hw_usb_read_dcpmaxp(); current_dcpmaxp = current_dcpmaxp & (~RX65N_USB_DCPMAXP_MXPS_MASK); current_dcpmaxp |= maxpacketsize; current_dcpmaxp = current_dcpmaxp & (~RX65N_USB_DCPMAXP_DEVADDR_MASK); current_dcpmaxp |= funcaddr << RX65N_USB_DCPMAXP_DEVADDR_SHIFT; - hw_usb_write_dcpmxps (current_dcpmaxp); + hw_usb_write_dcpmxps(current_dcpmaxp); - hw_usb_set_curpipe (USB_CUSE, USB_PIPE0); - hw_usb_set_bclr (USB_CUSE); + hw_usb_set_curpipe(USB_CUSE, USB_PIPE0); + hw_usb_set_bclr(USB_CUSE); nxmutex_unlock(&priv->lock); return OK; @@ -6624,8 +6615,8 @@ static int rx65n_usbhost_ep0configure(struct usbhost_driver_s *drvr, ****************************************************************************/ static int rx65n_usbhost_epalloc(struct usbhost_driver_s *drvr, - const struct usbhost_epdesc_s *epdesc, - usbhost_ep_t *ep) + const struct usbhost_epdesc_s *epdesc, + usbhost_ep_t *ep) { struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr; struct usbhost_hubport_s *hport; @@ -6681,7 +6672,7 @@ static int rx65n_usbhost_epalloc(struct usbhost_driver_s *drvr, pipe_type = USB_EP_ISO; } - pipe_num = usb_hstd_get_pipe_no (pipe_type, pipe_dir); + pipe_num = usb_hstd_get_pipe_no(pipe_type, pipe_dir); DEBUGASSERT(pipe_no == USB_NULL); g_usb_pipe_table[pipe_num].use_flag = USB_TRUE; @@ -6810,7 +6801,7 @@ static int rx65n_usbhost_epalloc(struct usbhost_driver_s *drvr, ****************************************************************************/ static int rx65n_usbhost_epfree(struct usbhost_driver_s *drvr, - usbhost_ep_t ep) + usbhost_ep_t ep) { struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr; struct rx65n_usbhost_ed_s *ed = (struct rx65n_usbhost_ed_s *)ep; @@ -6892,7 +6883,7 @@ static int rx65n_usbhost_epfree(struct usbhost_driver_s *drvr, ****************************************************************************/ static int rx65n_usbhost_alloc(struct usbhost_driver_s *drvr, - uint8_t **buffer, size_t *maxlen) + uint8_t **buffer, size_t *maxlen) { struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr; @@ -6982,7 +6973,7 @@ static int rx65n_usbhost_free(struct usbhost_driver_s *drvr, uint8_t *buffer) ****************************************************************************/ static int rx65n_usbhost_ioalloc(struct usbhost_driver_s *drvr, - uint8_t **buffer, size_t buflen) + uint8_t **buffer, size_t buflen) { FAR uint8_t *alloc; @@ -7026,7 +7017,7 @@ static int rx65n_usbhost_ioalloc(struct usbhost_driver_s *drvr, ****************************************************************************/ static int rx65n_usbhost_iofree(struct usbhost_driver_s *drvr, - uint8_t *buffer) + uint8_t *buffer) { DEBUGASSERT(drvr && buffer); @@ -7076,14 +7067,14 @@ static int rx65n_usbhost_iofree(struct usbhost_driver_s *drvr, ****************************************************************************/ static int rx65n_usbhost_ctrlin(struct usbhost_driver_s *drvr, - usbhost_ep_t ep0, - const struct usb_ctrlreq_s *req, - uint8_t *buffer) + usbhost_ep_t ep0, + const struct usb_ctrlreq_s *req, + uint8_t *buffer) { struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr; struct rx65n_usbhost_ed_s *ed = (struct rx65n_usbhost_ed_s *)ep0; uint16_t len; - int ret; + int ret; uint8_t req_type; uint8_t req_req; @@ -7157,7 +7148,7 @@ static int rx65n_usbhost_ctrlin(struct usbhost_driver_s *drvr, /* for read does the calculation correctly */ g_rx65n_edlist[kbd_interrupt_in_pipe].xfrinfo->xfrd = 0; - usb_cstd_set_buf((uint16_t) kbd_interrupt_in_pipe); /* Set BUF */ + usb_cstd_set_buf(kbd_interrupt_in_pipe); /* Set BUF */ } return ret; @@ -7170,7 +7161,7 @@ static int rx65n_usbhost_ctrlout(struct usbhost_driver_s *drvr, struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr; struct rx65n_usbhost_ed_s *ed = (struct rx65n_usbhost_ed_s *)ep0; uint16_t len; - int ret; + int ret; static int dev_addressed_state = 0; /* Assumption : This control out is called first time for @@ -7249,9 +7240,8 @@ static int rx65n_usbhost_ctrlout(struct usbhost_driver_s *drvr, ****************************************************************************/ static int rx65n_usbhost_transfer_common(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed, - uint8_t *buffer, - size_t buflen) + struct rx65n_usbhost_ed_s *ed, + uint8_t *buffer, size_t buflen) { struct rx65n_usbhost_xfrinfo_s *xfrinfo; uint32_t dirpid; @@ -7288,7 +7278,7 @@ static int rx65n_usbhost_transfer_common(struct rx65n_usbhost_s *priv, if (ed->pipenum == USB_PIPE6 && in == 1) { - usb_hstd_receive_start (buffer, buflen, ed->pipenum); + usb_hstd_receive_start(buffer, buflen, ed->pipenum); } if (ret == OK) @@ -7301,11 +7291,11 @@ static int rx65n_usbhost_transfer_common(struct rx65n_usbhost_s *priv, { if (in) { - usb_hstd_receive_start (buffer, buflen, ed->pipenum); + usb_hstd_receive_start(buffer, buflen, ed->pipenum); } else { - usb_hstd_send_start (buffer, buflen, ed->pipenum); + usb_hstd_send_start(buffer, buflen, ed->pipenum); } } } @@ -7340,11 +7330,11 @@ static int rx65n_usbhost_transfer_common(struct rx65n_usbhost_s *priv, #if RX65N_USBHOST_IOBUFFERS > 0 static int rx65n_usbhost_dma_alloc(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed, - uint8_t *userbuffer, - size_t buflen, uint8_t **alloc) + struct rx65n_usbhost_ed_s *ed, + uint8_t *userbuffer, size_t buflen, + uint8_t **alloc) { - syslog (LOG_INFO, "Debug : %s(): Line : %d\n", __func__, __LINE__); + syslog(LOG_INFO, "Debug : %s(): Line : %d\n", __func__, __LINE__); /* This need to be impemented if DMA is used */ @@ -7377,11 +7367,11 @@ static int rx65n_usbhost_dma_alloc(struct rx65n_usbhost_s *priv, ****************************************************************************/ static void rx65n_usbhost_dma_free(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed, - uint8_t *userbuffer, - size_t buflen, uint8_t *newbuffer) + struct rx65n_usbhost_ed_s *ed, + uint8_t *userbuffer, size_t buflen, + uint8_t *newbuffer) { - syslog (LOG_INFO, "Debug : %s(): Line : %d\n", __func__, __LINE__); + syslog(LOG_INFO, "Debug : %s(): Line : %d\n", __func__, __LINE__); } #endif @@ -7425,7 +7415,8 @@ static void rx65n_usbhost_dma_free(struct rx65n_usbhost_s *priv, ****************************************************************************/ static ssize_t rx65n_usbhost_transfer(struct usbhost_driver_s *drvr, - usbhost_ep_t ep, uint8_t *buffer, size_t buflen) + usbhost_ep_t ep, + uint8_t *buffer, size_t buflen) { struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr; struct rx65n_usbhost_ed_s *ed = (struct rx65n_usbhost_ed_s *)ep; @@ -7646,7 +7637,7 @@ errout_with_lock: #ifdef CONFIG_USBHOST_ASYNCH static void rx65n_usbhost_asynch_completion(struct rx65n_usbhost_s *priv, - struct rx65n_usbhost_ed_s *ed) + struct rx65n_usbhost_ed_s *ed) { struct rx65n_usbhost_xfrinfo_s *xfrinfo; usbhost_asynch_t callback; @@ -7753,9 +7744,9 @@ static void rx65n_usbhost_asynch_completion(struct rx65n_usbhost_s *priv, #ifdef CONFIG_USBHOST_ASYNCH static int rx65n_usbhost_asynch(struct usbhost_driver_s *drvr, - usbhost_ep_t ep, - uint8_t *buffer, size_t buflen, - usbhost_asynch_t callback, void *arg) + usbhost_ep_t ep, + uint8_t *buffer, size_t buflen, + usbhost_asynch_t callback, void *arg) { struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr; struct rx65n_usbhost_ed_s *ed = (struct rx65n_usbhost_ed_s *)ep; @@ -7870,7 +7861,7 @@ errout_with_lock: ****************************************************************************/ static int rx65n_usbhost_cancel(FAR struct usbhost_driver_s *drvr, - usbhost_ep_t ep) + usbhost_ep_t ep) { #ifdef CONFIG_USBHOST_ASYNCH struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr; @@ -7991,8 +7982,8 @@ static int rx65n_usbhost_cancel(FAR struct usbhost_driver_s *drvr, #ifdef CONFIG_USBHOST_HUB static int rx65n_usbhost_connect(FAR struct usbhost_driver_s *drvr, - FAR struct usbhost_hubport_s *hport, - bool connected) + FAR struct usbhost_hubport_s *hport, + bool connected) { struct rx65n_usbhost_s *priv = (struct rx65n_usbhost_s *)drvr; DEBUGASSERT(priv != NULL && hport != NULL); @@ -8011,10 +8002,10 @@ static int rx65n_usbhost_connect(FAR struct usbhost_driver_s *drvr, ret = usbhost_enumerate(hport, &hport->devclass); if (ret < 0) { - syslog (LOG_INFO, "Enumeration failed with %d", ret); + syslog(LOG_INFO, "Enumeration failed with %d", ret); } - hw_usb_write_dcpmxps((uint16_t) (USB_DEFPACKET + USB_DEVICE_1)); + hw_usb_write_dcpmxps(USB_DEFPACKET + USB_DEVICE_1); if (hport->speed == USB_SPEED_LOW) { @@ -8029,14 +8020,14 @@ static int rx65n_usbhost_connect(FAR struct usbhost_driver_s *drvr, break; default: - syslog (LOG_INFO, "Undefined Port"); + syslog(LOG_INFO, "Undefined Port"); break; } } if (ret >= 0) { - syslog (LOG_INFO, "Hub Port device enumerated\n"); + syslog(LOG_INFO, "Hub Port device enumerated\n"); } return OK; @@ -8070,7 +8061,7 @@ static int rx65n_usbhost_connect(FAR struct usbhost_driver_s *drvr, ****************************************************************************/ static void rx65n_usbhost_disconnect(struct usbhost_driver_s *drvr, - struct usbhost_hubport_s *hport) + struct usbhost_hubport_s *hport) { int i; struct rx65n_usbhost_s *priv = &g_usbhost; @@ -8102,7 +8093,7 @@ static void rx65n_usbhost_disconnect(struct usbhost_driver_s *drvr, g_kbdpipe = 0; g_hubkbd = false; - syslog (LOG_INFO, "KBD Device Disconnected from Hub\n"); + syslog(LOG_INFO, "KBD Device Disconnected from Hub\n"); } if (hport->speed == USB_SPEED_FULL) @@ -8116,7 +8107,7 @@ static void rx65n_usbhost_disconnect(struct usbhost_driver_s *drvr, } } - syslog (LOG_INFO, "MSC Device Disconnected from Hub\n"); + syslog(LOG_INFO, "MSC Device Disconnected from Hub\n"); } } @@ -8235,7 +8226,7 @@ static inline void rx65n_usbhost_ep0init(struct rx65n_usbhost_s *priv) /* Initialize the common tail TD. */ memset(TDTAIL, 0, sizeof(struct rx65n_usbhost_gtd_s)); - TDTAIL->ed = EDCTRL; + TDTAIL->ed = EDCTRL; /* Link the common tail TD to the ED's TD list */ @@ -8393,9 +8384,9 @@ struct usbhost_connection_s *rx65n_usbhost_initialize(int controller) putreg32(0, RX65N_USB_DPUSR0R); /* FIT code writes 0 to this DPUSR0R */ hw_usb_hmodule_init(); - rx65n_usbhost_setbit (RX65N_USB_SOFCFG, RX65N_USB_SOFCFG_TRNENSEL); + rx65n_usbhost_setbit(RX65N_USB_SOFCFG, RX65N_USB_SOFCFG_TRNENSEL); - hw_usb_set_vbout (); + hw_usb_set_vbout(); up_mdelay(100); leave_critical_section(flags); @@ -8480,14 +8471,14 @@ struct usbhost_connection_s *rx65n_usbhost_initialize(int controller) if (irq_attach(RX65N_INTB185_IRQ, rx65n_usbhost_usbinterrupt, NULL) != 0) { - syslog (LOG_INFO, "ERROR: Failed to attach IRQ\n"); + syslog(LOG_INFO, "ERROR: Failed to attach IRQ\n"); return NULL; } IEN(PERIB, INTB185) = 1U; - syslog (LOG_INFO, "Debug:USB host Initialized, Device connected:%s\n", - priv->connected ? "YES" : "NO"); + syslog(LOG_INFO, "Debug:USB host Initialized, Device connected:%s\n", + priv->connected ? "YES" : "NO"); return &g_usbconn; } diff --git a/arch/risc-v/src/bl602/bl602_i2c.c b/arch/risc-v/src/bl602/bl602_i2c.c index 1ca0d7fb5c..9a1d4cead0 100644 --- a/arch/risc-v/src/bl602/bl602_i2c.c +++ b/arch/risc-v/src/bl602/bl602_i2c.c @@ -115,8 +115,8 @@ struct bl602_i2c_priv_s ****************************************************************************/ static int bl602_i2c_transfer(struct i2c_master_s *dev, - struct i2c_msg_s * msgs, - int count); + struct i2c_msg_s *msgs, + int count); #ifdef CONFIG_I2C_RESET static int bl602_i2c_reset(struct i2c_master_s *dev); @@ -658,8 +658,8 @@ static void bl602_i2c_set_freq(int freq) ****************************************************************************/ static int bl602_i2c_transfer(struct i2c_master_s *dev, - struct i2c_msg_s * msgs, - int count) + struct i2c_msg_s *msgs, + int count) { int i; int j; @@ -943,7 +943,7 @@ static int bl602_i2c_irq(int cpuint, void *context, void *arg) struct i2c_master_s *bl602_i2cbus_initialize(int port) { - struct bl602_i2c_priv_s * priv; + struct bl602_i2c_priv_s *priv; const struct bl602_i2c_config_s *config; switch (port) diff --git a/arch/risc-v/src/bl602/bl602_netdev.c b/arch/risc-v/src/bl602/bl602_netdev.c index 2bb2ff7232..24f315871e 100644 --- a/arch/risc-v/src/bl602/bl602_netdev.c +++ b/arch/risc-v/src/bl602/bl602_netdev.c @@ -184,8 +184,8 @@ struct rx_pending_item_s { struct list_node node; struct bl602_net_driver_s *priv; /* Which interface should to deliver */ - uint8_t * data; - int len; + uint8_t *data; + int len; }; /**************************************************************************** @@ -1174,7 +1174,7 @@ static void scan_complete_indicate(void *data, void *param) { int i; struct scan_parse_param_s *para; - wifi_mgmr_scan_item_t * scan; + wifi_mgmr_scan_item_t *scan; para = (struct scan_parse_param_s *)data; DEBUGASSERT(para != NULL); @@ -1506,7 +1506,7 @@ bl602_net_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) case SIOCSIWSCAN: do { - struct iwreq * req = (struct iwreq *)arg; + struct iwreq *req = (struct iwreq *)arg; struct scan_parse_param_s *para = NULL; para = kmm_malloc(sizeof(struct scan_parse_param_s)); @@ -1603,9 +1603,9 @@ bl602_net_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) case SIOCSIWENCODEEXT: /* Set psk */ do { - struct iwreq * req = (struct iwreq *)arg; + struct iwreq *req = (struct iwreq *)arg; struct iw_encode_ext *ext = req->u.encoding.pointer; - char * passphrase = kmm_malloc(ext->key_len + 1); + char *passphrase = kmm_malloc(ext->key_len + 1); if (passphrase == NULL) { return -ENOMEM; @@ -1673,7 +1673,7 @@ bl602_net_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) } #endif - priv->wlan = wifi_mgmr_sta_enable((void *)priv); + priv->wlan = wifi_mgmr_sta_enable(priv); memcpy(priv->wlan->mac, priv->net_dev.d_mac.ether.ether_addr_octet, @@ -1694,7 +1694,7 @@ bl602_net_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) } #endif - priv->wlan = wifi_mgmr_ap_enable((void *)priv); + priv->wlan = wifi_mgmr_ap_enable(priv); memcpy(priv->wlan->mac, priv->net_dev.d_mac.ether.ether_addr_octet, 6); @@ -1847,9 +1847,9 @@ bl602_net_ioctl(struct net_driver_s *dev, int cmd, unsigned long arg) case SIOCGIWENCODEEXT: /* Get encoding token mode */ do { - struct iwreq * req = (struct iwreq *)arg; + struct iwreq *req = (struct iwreq *)arg; struct iw_encode_ext *ext; - wifi_mgmr_t * mgmr = bl602_netdev_get_wifi_mgmr(priv); + wifi_mgmr_t *mgmr = bl602_netdev_get_wifi_mgmr(priv); int length; DEBUGASSERT(mgmr != NULL); @@ -2106,8 +2106,8 @@ void bl602_net_event(int evt, int val) int bl602_net_initialize(void) { struct bl602_net_driver_s *priv; - int idx; - uint8_t mac[6]; + int idx; + uint8_t mac[6]; list_initialize(&g_rx_pending); @@ -2181,7 +2181,7 @@ int bl602_net_initialize(void) wifi_mgmr_scan_filter_hidden_ssid(0); - priv->current_mode = IW_MODE_AUTO; + priv->current_mode = IW_MODE_AUTO; /* Register the device with the OS so that socket IOCTLs can be * performed diff --git a/arch/risc-v/src/bl602/bl602_rtc_lowerhalf.c b/arch/risc-v/src/bl602/bl602_rtc_lowerhalf.c index 839dd65704..ae11d9e521 100644 --- a/arch/risc-v/src/bl602/bl602_rtc_lowerhalf.c +++ b/arch/risc-v/src/bl602/bl602_rtc_lowerhalf.c @@ -154,7 +154,7 @@ static const struct rtc_ops_s g_rtc_ops = static struct bl602_lowerhalf_s g_rtc_lowerhalf = { - .ops = &g_rtc_ops, + .ops = &g_rtc_ops, .devlock = NXMUTEX_INITIALIZER, }; diff --git a/arch/risc-v/src/bl602/bl602_spi.c b/arch/risc-v/src/bl602/bl602_spi.c index 00c732dbc1..402177a858 100644 --- a/arch/risc-v/src/bl602/bl602_spi.c +++ b/arch/risc-v/src/bl602/bl602_spi.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -1480,7 +1481,7 @@ void bl602_spi_dma_init(struct spi_dev_s *dev) /* Request a DMA channel for SPI peripheral */ priv->dma_rxchan = bl602_dma_channel_request(bl602_dma_rx_callback, - (void *)priv); + priv); if (priv->dma_rxchan < 0) { spierr("Failed to allocate GDMA channel\n"); @@ -1490,7 +1491,7 @@ void bl602_spi_dma_init(struct spi_dev_s *dev) } priv->dma_txchan = bl602_dma_channel_request(bl602_dma_tx_callback, - (void *)priv); + priv); if (priv->dma_txchan < 0) { spierr("Failed to allocate GDMA channel\n"); diff --git a/arch/risc-v/src/esp32c3/esp32c3_rng.c b/arch/risc-v/src/esp32c3/esp32c3_rng.c index f100f413f2..3a5b0b65bf 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_rng.c +++ b/arch/risc-v/src/esp32c3/esp32c3_rng.c @@ -80,7 +80,7 @@ static struct rng_dev_s g_rngdev = static const struct file_operations g_rngops = { - .read = esp32c3_rng_read, /* read */ + .read = esp32c3_rng_read, /* read */ }; /**************************************************************************** diff --git a/arch/risc-v/src/mpfs/mpfs_ihc.c b/arch/risc-v/src/mpfs/mpfs_ihc.c index af9ab4b9fe..69e7ec4d2a 100644 --- a/arch/risc-v/src/mpfs/mpfs_ihc.c +++ b/arch/risc-v/src/mpfs/mpfs_ihc.c @@ -171,11 +171,11 @@ static int mpfs_rptun_register_callback(struct rptun_dev_s *dev, uint8_t unused_filler[0x80000] __attribute__((section(".filler_area"))); -static struct rpmsg_endpoint g_mpgs_echo_ping_ept; -static struct mpfs_queue_table_s g_mpfs_virtqueue_table[VRINGS]; -static struct mpfs_rptun_shmem_s g_shmem; -static struct rpmsg_device *g_mpfs_rpmsg_device; -static struct rpmsg_virtio_device *g_mpfs_virtio_device; +static struct rpmsg_endpoint g_mpgs_echo_ping_ept; +static struct mpfs_queue_table_s g_mpfs_virtqueue_table[VRINGS]; +static struct mpfs_rptun_shmem_s g_shmem; +static struct rpmsg_device *g_mpfs_rpmsg_device; +static struct rpmsg_virtio_device *g_mpfs_virtio_device; static sem_t g_mpfs_ack_sig = SEM_INITIALIZER(0); static sem_t g_mpfs_rx_sig = SEM_INITIALIZER(0); diff --git a/arch/xtensa/src/esp32/esp32_i2s.c b/arch/xtensa/src/esp32/esp32_i2s.c index 876499f963..3c6ed2c495 100644 --- a/arch/xtensa/src/esp32/esp32_i2s.c +++ b/arch/xtensa/src/esp32/esp32_i2s.c @@ -264,20 +264,20 @@ struct esp32_transport_s struct esp32_i2s_s { - struct i2s_dev_s dev; /* Externally visible I2S interface */ - mutex_t lock; /* Ensures mutually exclusive access */ - int cpuint; /* I2S interrupt ID */ - uint8_t cpu; /* CPU ID */ - spinlock_t slock; /* Device specific lock. */ + struct i2s_dev_s dev; /* Externally visible I2S interface */ + mutex_t lock; /* Ensures mutually exclusive access */ + int cpuint; /* I2S interrupt ID */ + uint8_t cpu; /* CPU ID */ + spinlock_t slock; /* Device specific lock. */ /* Port configuration */ const struct esp32_i2s_config_s *config; - uint32_t mclk_freq; /* I2S actual master clock */ - uint32_t channels; /* Audio channels (1:mono or 2:stereo) */ - uint32_t rate; /* I2S actual configured sample-rate */ - uint32_t data_width; /* I2S actual configured data_width */ + uint32_t mclk_freq; /* I2S actual master clock */ + uint32_t channels; /* Audio channels (1:mono or 2:stereo) */ + uint32_t rate; /* I2S actual configured sample-rate */ + uint32_t data_width; /* I2S actual configured data_width */ #ifdef I2S_HAVE_TX struct esp32_transport_s tx; /* TX transport state */ @@ -410,9 +410,9 @@ static const struct esp32_i2s_config_s esp32_i2s0_config = static struct esp32_i2s_s esp32_i2s0_priv = { .dev = - { - .ops = &g_i2sops - }, + { + .ops = &g_i2sops, + }, .lock = NXMUTEX_INITIALIZER, .config = &esp32_i2s0_config, .bufsem = SEM_INITIALIZER(0), @@ -471,9 +471,9 @@ static const struct esp32_i2s_config_s esp32_i2s1_config = static struct esp32_i2s_s esp32_i2s1_priv = { .dev = - { - .ops = &g_i2sops - }, + { + .ops = &g_i2sops, + }, .lock = NXMUTEX_INITIALIZER, .config = &esp32_i2s1_config, .bufsem = SEM_INITIALIZER(0), @@ -614,8 +614,6 @@ static void i2s_buf_free(struct esp32_i2s_s *priv, static int i2s_buf_initialize(struct esp32_i2s_s *priv) { - int ret; - priv->tx.carry.bytes = 0; priv->tx.carry.value = 0; @@ -1786,7 +1784,6 @@ static int esp32_i2s_send(struct i2s_dev_s *dev, struct ap_buffer_s *apb, bfcontainer->result = -EBUSY; ret = i2s_txdma_setup(priv, bfcontainer); - if (ret != OK) { goto errout_with_buf; @@ -1797,7 +1794,6 @@ static int esp32_i2s_send(struct i2s_dev_s *dev, struct ap_buffer_s *apb, apb->nbytes - apb->curbyte); nxmutex_unlock(&priv->lock); - return OK; errout_with_buf: diff --git a/arch/xtensa/src/esp32/esp32_rng.c b/arch/xtensa/src/esp32/esp32_rng.c index d1193381cb..0d2fcc2d39 100644 --- a/arch/xtensa/src/esp32/esp32_rng.c +++ b/arch/xtensa/src/esp32/esp32_rng.c @@ -81,7 +81,7 @@ static struct rng_dev_s g_rngdev = static const struct file_operations g_rngops = { - .read = esp32_rng_read, /* read */ + .read = esp32_rng_read, /* read */ }; /**************************************************************************** diff --git a/arch/xtensa/src/esp32/esp32_serial.c b/arch/xtensa/src/esp32/esp32_serial.c index 33067719ff..172c6e7715 100644 --- a/arch/xtensa/src/esp32/esp32_serial.c +++ b/arch/xtensa/src/esp32/esp32_serial.c @@ -244,7 +244,7 @@ struct esp32_config_s #endif #ifdef CONFIG_SERIAL_TXDMA uint8_t dma_chan; /* DMA instance 0-1 */ - sem_t * dma_sem; /* DMA semaphore */ + sem_t *dma_sem; /* DMA semaphore */ #endif #ifdef HAVE_RS485 uint8_t rs485_dir_gpio; /* UART RS-485 DIR GPIO pin cfg */ @@ -1471,8 +1471,8 @@ static int esp32_ioctl(struct file *filep, int cmd, unsigned long arg) #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: { - struct termios *termiosp = (struct termios *)arg; - struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv; + struct termios *termiosp = (struct termios *)arg; + struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv; if (!termiosp) { @@ -1531,8 +1531,8 @@ static int esp32_ioctl(struct file *filep, int cmd, unsigned long arg) case TCSETS: { - struct termios *termiosp = (struct termios *)arg; - struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv; + struct termios *termiosp = (struct termios *)arg; + struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv; uint32_t baud; uint32_t intena; uint8_t parity; diff --git a/arch/xtensa/src/esp32/esp32_wifi_utils.c b/arch/xtensa/src/esp32/esp32_wifi_utils.c index 392fae49bc..ceeaf146de 100644 --- a/arch/xtensa/src/esp32/esp32_wifi_utils.c +++ b/arch/xtensa/src/esp32/esp32_wifi_utils.c @@ -424,7 +424,7 @@ void esp_wifi_scan_event_parse(void) /* Copy ESSID */ essid_len = MIN(strlen((const char *) - ap_list_buffer[bss_count].ssid), 32); + ap_list_buffer[bss_count].ssid), 32); essid_len_aligned = (essid_len + 3) & -4; if (result_size < ESP_IW_EVENT_SIZE(essid)+essid_len_aligned) { diff --git a/arch/xtensa/src/esp32s2/esp32s2_i2s.c b/arch/xtensa/src/esp32s2/esp32s2_i2s.c index 8bd48262c9..6e67403e98 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_i2s.c +++ b/arch/xtensa/src/esp32s2/esp32s2_i2s.c @@ -393,9 +393,9 @@ static const struct esp32s2_i2s_config_s esp32s2_i2s0_config = static struct esp32s2_i2s_s esp32s2_i2s0_priv = { .dev = - { - .ops = &g_i2sops - }, + { + .ops = &g_i2sops + }, .lock = NXMUTEX_INITIALIZER, .config = &esp32s2_i2s0_config, .bufsem = SEM_INITIALIZER(0) diff --git a/arch/xtensa/src/esp32s2/esp32s2_rng.c b/arch/xtensa/src/esp32s2/esp32s2_rng.c index 4417b35280..54b19ba6dc 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_rng.c +++ b/arch/xtensa/src/esp32s2/esp32s2_rng.c @@ -83,7 +83,7 @@ static struct rng_dev_s g_rngdev = static const struct file_operations g_rngops = { - .read = esp32s2_rng_read, /* read */ + .read = esp32s2_rng_read, /* read */ }; /**************************************************************************** diff --git a/arch/z80/src/ez80/ez80_i2c.c b/arch/z80/src/ez80/ez80_i2c.c index db633c169e..3e1447cdba 100644 --- a/arch/z80/src/ez80/ez80_i2c.c +++ b/arch/z80/src/ez80/ez80_i2c.c @@ -92,7 +92,7 @@ static int ez80_i2c_transfer(FAR struct i2c_master_s *dev, static bool g_initialized; /* true:I2C has been initialized */ static mutex_t g_i2clock = NXMUTEX_INITIALIZER; /* Serialize I2C transfers */ -const struct i2c_ops_s g_ops = +static const struct i2c_ops_s g_ops = { ez80_i2c_transfer }; diff --git a/arch/z80/src/z8/z8_i2c.c b/arch/z80/src/z8/z8_i2c.c index 099ccfc772..3a51d50036 100644 --- a/arch/z80/src/z8/z8_i2c.c +++ b/arch/z80/src/z8/z8_i2c.c @@ -586,7 +586,7 @@ static int z8_i2c_transfer(FAR struct i2c_master_s *dev, ****************************************************************************/ #ifdef CONFIG_I2C_RESET -static int z8_i2c_reset(FAR struct i2c_master_s * dev) +static int z8_i2c_reset(FAR struct i2c_master_s *dev) { return OK; } diff --git a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c index 9ef611093b..17101fad3d 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c +++ b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c @@ -598,7 +598,7 @@ int imageproc_convert_rgb2yuv(uint8_t *ibuf, void imageproc_convert_yuv2gray(uint8_t * ibuf, uint8_t * obuf, size_t hsize, size_t vsize) { - uint16_t *p_src = (uint16_t *) ibuf; + uint16_t *p_src = (uint16_t *)ibuf; size_t ix; size_t iy; diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c index faa8c85227..25f90b6bbb 100644 --- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c +++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_touchscreen.c @@ -747,7 +747,7 @@ static void tc_worker(void *arg) * the on-board transistor drive logic to energize the touch panel. */ - *((uint32_t *) LCD_TP_PORT_SETRESET) = LCD_SAMPY_BITS; + *((uint32_t *)LCD_TP_PORT_SETRESET) = LCD_SAMPY_BITS; /* Allow time for the Y DRIVE to settle */ @@ -813,7 +813,7 @@ static void tc_worker(void *arg) * the on-board transistor drive logic to energize the touch panel. */ - *((uint32_t *) LCD_TP_PORT_SETRESET) = LCD_SAMPY_BITS; + *((uint32_t *)LCD_TP_PORT_SETRESET) = LCD_SAMPY_BITS; /* Allow time for the Y DRIVE to settle */ @@ -881,7 +881,7 @@ static void tc_worker(void *arg) * touch panel. */ - *((uint32_t *) LCD_TP_PORT_SETRESET) = LCD_SAMPX_BITS; + *((uint32_t *)LCD_TP_PORT_SETRESET) = LCD_SAMPX_BITS; /* Allow time for the X sampling */ @@ -1091,10 +1091,10 @@ static void tc_worker(void *arg) static int tc_open(struct file *filep) { #ifdef CONFIG_TOUCHSCREEN_REFCNT - struct inode *inode; - struct tc_dev_s *priv; - uint8_t tmp; - int ret; + struct inode *inode; + struct tc_dev_s *priv; + uint8_t tmp; + int ret; DEBUGASSERT(filep); inode = filep->f_inode; @@ -1144,9 +1144,9 @@ errout_with_lock: static int tc_close(struct file *filep) { #ifdef CONFIG_TOUCHSCREEN_REFCNT - struct inode *inode; - struct tc_dev_s *priv; - int ret; + struct inode *inode; + struct tc_dev_s *priv; + int ret; DEBUGASSERT(filep); inode = filep->f_inode; @@ -1347,13 +1347,12 @@ static int tc_ioctl(struct file *filep, int cmd, unsigned long arg) * Name: tc_poll ****************************************************************************/ -static int tc_poll(struct file *filep, struct pollfd *fds, - bool setup) +static int tc_poll(struct file *filep, struct pollfd *fds, bool setup) { - struct inode *inode; - struct tc_dev_s *priv; - int ret; - int i; + struct inode *inode; + struct tc_dev_s *priv; + int ret; + int i; iinfo("setup: %d\n", (int)setup); DEBUGASSERT(filep && fds); diff --git a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c index 18a142eecb..8f1ab3f7f7 100644 --- a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c +++ b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_touchscreen.c @@ -968,10 +968,10 @@ static void tc_worker(void *arg) static int tc_open(struct file *filep) { #ifdef CONFIG_TOUCHSCREEN_REFCNT - struct inode *inode; - struct tc_dev_s *priv; - uint8_t tmp; - int ret; + struct inode *inode; + struct tc_dev_s *priv; + uint8_t tmp; + int ret; DEBUGASSERT(filep); inode = filep->f_inode; @@ -1021,9 +1021,9 @@ errout_with_lock: static int tc_close(struct file *filep) { #ifdef CONFIG_TOUCHSCREEN_REFCNT - struct inode *inode; - struct tc_dev_s *priv; - int ret; + struct inode *inode; + struct tc_dev_s *priv; + int ret; DEBUGASSERT(filep); inode = filep->f_inode; @@ -1185,9 +1185,9 @@ static int tc_ioctl(struct file *filep, int cmd, unsigned long arg) iinfo("cmd: %d arg: %ld\n", cmd, arg); return -ENOTTY; /* None yet supported */ #else - struct inode *inode; - struct tc_dev_s *priv; - int ret; + struct inode *inode; + struct tc_dev_s *priv; + int ret; iinfo("cmd: %d arg: %ld\n", cmd, arg); DEBUGASSERT(filep); @@ -1224,13 +1224,12 @@ static int tc_ioctl(struct file *filep, int cmd, unsigned long arg) * Name: tc_poll ****************************************************************************/ -static int tc_poll(struct file *filep, struct pollfd *fds, - bool setup) +static int tc_poll(struct file *filep, struct pollfd *fds, bool setup) { - struct inode *inode; - struct tc_dev_s *priv; - int ret; - int i; + struct inode *inode; + struct tc_dev_s *priv; + int ret; + int i; iinfo("setup: %d\n", (int)setup); DEBUGASSERT(filep && fds); diff --git a/crypto/random_pool.c b/crypto/random_pool.c index 9348dbfe0b..086b1d8f6b 100644 --- a/crypto/random_pool.c +++ b/crypto/random_pool.c @@ -45,8 +45,8 @@ # define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif -#define ROTL_32(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) -#define ROTR_32(x,n) ( ((x) >> (n)) | ((x) << (32-(n))) ) +#define ROTL_32(x,n) (((x) << (n)) | ((x) >> (32 - (n)))) +#define ROTR_32(x,n) (((x) >> (n)) | ((x) << (32 - (n)))) /**************************************************************************** * Private Function Prototypes diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 2c5b9df6ed..7ec42d871e 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -1665,8 +1665,8 @@ int uart_register(FAR const char *path, FAR uart_dev_t *dev) nxmutex_init(&dev->xmit.lock); nxmutex_init(&dev->recv.lock); nxmutex_init(&dev->closelock); - nxsem_init(&dev->xmitsem, 0, 0); - nxsem_init(&dev->recvsem, 0, 0); + nxsem_init(&dev->xmitsem, 0, 0); + nxsem_init(&dev->recvsem, 0, 0); nxmutex_init(&dev->polllock); /* Register the serial driver */ diff --git a/drivers/usbhost/usbhost_hidkbd.c b/drivers/usbhost/usbhost_hidkbd.c index 6664ded5b5..148e57b5e1 100644 --- a/drivers/usbhost/usbhost_hidkbd.c +++ b/drivers/usbhost/usbhost_hidkbd.c @@ -284,7 +284,7 @@ static inline int usbhost_tdfree(FAR struct usbhost_state_s *priv); /* struct usbhost_registry_s methods */ -static struct usbhost_class_s *usbhost_create( +static FAR struct usbhost_class_s *usbhost_create( FAR struct usbhost_hubport_s *hport, FAR const struct usbhost_id_s *id); @@ -355,7 +355,7 @@ static uint32_t g_devinuse; static mutex_t g_lock = NXMUTEX_INITIALIZER; static sem_t g_syncsem = SEM_INITIALIZER(0); -static struct usbhost_state_s *g_priv; /* Data passed to thread */ +static FAR struct usbhost_state_s *g_priv; /* The following tables map keyboard scan codes to printable ASIC * characters. There is no support here for function keys or cursor @@ -1833,8 +1833,8 @@ static int usbhost_tdfree(FAR struct usbhost_state_s *priv) ****************************************************************************/ static FAR struct usbhost_class_s * - usbhost_create(FAR struct usbhost_hubport_s *hport, - FAR const struct usbhost_id_s *id) +usbhost_create(FAR struct usbhost_hubport_s *hport, + FAR const struct usbhost_id_s *id) { FAR struct usbhost_state_s *priv; @@ -1978,7 +1978,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, * ****************************************************************************/ -static int usbhost_disconnected(struct usbhost_class_s *usbclass) +static int usbhost_disconnected(FAR struct usbhost_class_s *usbclass) { FAR struct usbhost_state_s *priv = (FAR struct usbhost_state_s *)usbclass; diff --git a/drivers/usbhost/usbhost_hidmouse.c b/drivers/usbhost/usbhost_hidmouse.c index 91eb387056..770f061401 100644 --- a/drivers/usbhost/usbhost_hidmouse.c +++ b/drivers/usbhost/usbhost_hidmouse.c @@ -334,9 +334,9 @@ static inline int usbhost_tdfree(FAR struct usbhost_state_s *priv); /* struct usbhost_registry_s methods */ -static struct usbhost_class_s * - usbhost_create(FAR struct usbhost_hubport_s *hport, - FAR const struct usbhost_id_s *id); +static FAR struct usbhost_class_s * +usbhost_create(FAR struct usbhost_hubport_s *hport, + FAR const struct usbhost_id_s *id); /* struct usbhost_class_s methods */ @@ -399,13 +399,13 @@ static const struct file_operations g_hidmouse_fops = /* This is a bitmap that is used to allocate device names /dev/mouse0-31. */ -static uint32_t g_devinuse; +static uint32_t g_devinuse; /* The following are used to managed the class creation operation */ static mutex_t g_lock = NXMUTEX_INITIALIZER; static sem_t g_syncsem = SEM_INITIALIZER(0); -static struct usbhost_state_s *g_priv; /* Data passed to thread */ +static FAR struct usbhost_state_s *g_priv; /**************************************************************************** * Private Functions @@ -1764,8 +1764,8 @@ static inline int usbhost_tdfree(FAR struct usbhost_state_s *priv) ****************************************************************************/ static FAR struct usbhost_class_s * - usbhost_create(FAR struct usbhost_hubport_s *hport, - FAR const struct usbhost_id_s *id) +usbhost_create(FAR struct usbhost_hubport_s *hport, + FAR const struct usbhost_id_s *id) { FAR struct usbhost_state_s *priv; @@ -1913,7 +1913,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, * ****************************************************************************/ -static int usbhost_disconnected(struct usbhost_class_s *usbclass) +static int usbhost_disconnected(FAR struct usbhost_class_s *usbclass) { FAR struct usbhost_state_s *priv = (FAR struct usbhost_state_s *)usbclass; int i; diff --git a/drivers/usbhost/usbhost_xboxcontroller.c b/drivers/usbhost/usbhost_xboxcontroller.c index 143ce39405..cc8c0b3fef 100644 --- a/drivers/usbhost/usbhost_xboxcontroller.c +++ b/drivers/usbhost/usbhost_xboxcontroller.c @@ -163,7 +163,7 @@ struct usbhost_state_s mutex_t lock; /* Used to maintain mutual exclusive access */ struct work_s work; /* For interacting with the worker thread */ FAR uint8_t *tbuffer; /* The allocated transfer buffer */ - FAR uint8_t obuffer[20]; /* The fixed output transfer buffer */ + uint8_t obuffer[20]; /* The fixed output transfer buffer */ size_t tbuflen; /* Size of the allocated transfer buffer */ usbhost_ep_t epin; /* IN endpoint */ usbhost_ep_t epout; /* OUT endpoint */ @@ -223,9 +223,9 @@ static inline int usbhost_tfree(FAR struct usbhost_state_s *priv); /* struct usbhost_registry_s methods */ -static struct usbhost_class_s * - usbhost_create(FAR struct usbhost_hubport_s *hport, - FAR const struct usbhost_id_s *id); +static FAR struct usbhost_class_s * +usbhost_create(FAR struct usbhost_hubport_s *hport, + FAR const struct usbhost_id_s *id); /* struct usbhost_class_s methods */ @@ -310,7 +310,7 @@ static uint32_t g_devinuse; static mutex_t g_lock = NXMUTEX_INITIALIZER; static sem_t g_syncsem = SEM_INITIALIZER(0); -static struct usbhost_state_s *g_priv; /* Data passed to thread */ +static FAR struct usbhost_state_s *g_priv; /**************************************************************************** * Private Functions @@ -1510,8 +1510,8 @@ static inline int usbhost_tfree(FAR struct usbhost_state_s *priv) ****************************************************************************/ static FAR struct usbhost_class_s * - usbhost_create(FAR struct usbhost_hubport_s *hport, - FAR const struct usbhost_id_s *id) +usbhost_create(FAR struct usbhost_hubport_s *hport, + FAR const struct usbhost_id_s *id) { FAR struct usbhost_state_s *priv; @@ -1651,7 +1651,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, * ****************************************************************************/ -static int usbhost_disconnected(struct usbhost_class_s *usbclass) +static int usbhost_disconnected(FAR struct usbhost_class_s *usbclass) { FAR struct usbhost_state_s *priv = (FAR struct usbhost_state_s *)usbclass; int i; @@ -1901,10 +1901,10 @@ static int usbhost_close(FAR struct file *filep) static ssize_t usbhost_read(FAR struct file *filep, FAR char *buffer, size_t len) { - FAR struct inode *inode; - FAR struct usbhost_state_s *priv; - FAR struct xbox_controller_buttonstate_s sample; - int ret; + FAR struct inode *inode; + FAR struct usbhost_state_s *priv; + struct xbox_controller_buttonstate_s sample; + int ret; DEBUGASSERT(filep && filep->f_inode && buffer); inode = filep->f_inode; diff --git a/drivers/video/isx012.c b/drivers/video/isx012.c index 242e41b015..35b946a6a0 100644 --- a/drivers/video/isx012.c +++ b/drivers/video/isx012.c @@ -3158,7 +3158,7 @@ int isx012_initialize(void) /* Initialize other information */ - priv->state = STATE_ISX012_POWEROFF; + priv->state = STATE_ISX012_POWEROFF; return OK; } diff --git a/include/nuttx/mutex.h b/include/nuttx/mutex.h index c8a3e6d97e..70c15db7df 100644 --- a/include/nuttx/mutex.h +++ b/include/nuttx/mutex.h @@ -528,7 +528,7 @@ static inline int nxrmutex_breaklock(FAR rmutex_t *rmutex, rmutex->count = 0; rmutex->holder = NXRMUTEX_NO_HOLDER; nxmutex_unlock(&rmutex->mutex); - ret = 0; + ret = OK; } return ret; diff --git a/wireless/bluetooth/bt_ioctl.c b/wireless/bluetooth/bt_ioctl.c index a94f41ccaf..c738dd7e30 100644 --- a/wireless/bluetooth/bt_ioctl.c +++ b/wireless/bluetooth/bt_ioctl.c @@ -70,7 +70,7 @@ struct btnet_discoverstate_s { struct bt_gatt_discover_params_s bd_params; struct bt_uuid_s bd_uuid; /* Discovery UUID */ - sem_t bd_donesem; /* Manages exclusive access */ + sem_t bd_donesem; /* Done notification */ }; /* GATT read state variables. */ @@ -79,7 +79,7 @@ struct btnet_rdstate_s { struct btreq_s *rd_btreq; uint8_t rd_result; /* The result of the read */ - sem_t rd_donesem; /* Manages exclusive access */ + sem_t rd_donesem; /* Done notification */ }; /* GATT write state variables. */ @@ -88,7 +88,7 @@ struct btnet_wrstate_s { struct btreq_s *wr_btreq; uint8_t wr_result; /* The result of the read */ - sem_t wr_donesem; /* Manages exclusive access */ + sem_t wr_donesem; /* Done notification */ }; /****************************************************************************