diff --git a/arch/arm/src/stm32/stm32_adc.c b/arch/arm/src/stm32/stm32_adc.c index c8715ab348..129e759dd4 100644 --- a/arch/arm/src/stm32/stm32_adc.c +++ b/arch/arm/src/stm32/stm32_adc.c @@ -2857,7 +2857,6 @@ static void adc_reset(FAR struct adc_dev_s *dev) { FAR struct stm32_dev_s *priv = (FAR struct stm32_dev_s *)dev->ad_priv; irqstate_t flags; - int ret; ainfo("intf: %d\n", priv->intf); flags = enter_critical_section(); @@ -2879,8 +2878,7 @@ static void adc_reset(FAR struct adc_dev_s *dev) /* Only if this is the first initialzied ADC instance in the ADC block */ #ifdef HAVE_ADC_CMN_DATA - ret = adccmn_lock(priv, true); - if (ret < 0) + if (adccmn_lock(priv, true) < 0) { return; } @@ -3041,7 +3039,6 @@ static int adc_setup(FAR struct adc_dev_s *dev) static void adc_shutdown(FAR struct adc_dev_s *dev) { FAR struct stm32_dev_s *priv = (FAR struct stm32_dev_s *)dev->ad_priv; - int ret; /* Disable ADC */ @@ -3059,8 +3056,7 @@ static void adc_shutdown(FAR struct adc_dev_s *dev) #endif #ifdef HAVE_ADC_CMN_DATA - ret = adccmn_lock(priv, true); - if (ret < 0) + if (adccmn_lock(priv, true) < 0) { return; } diff --git a/arch/arm/src/stm32/stm32_hciuart.c b/arch/arm/src/stm32/stm32_hciuart.c index 1b66de5975..ac8bb2c627 100644 --- a/arch/arm/src/stm32/stm32_hciuart.c +++ b/arch/arm/src/stm32/stm32_hciuart.c @@ -2101,7 +2101,7 @@ static ssize_t hciuart_read(const struct btuart_lowerhalf_s *lower, ret = nxsem_wait_uninterruptible(&state->rxwait); if (ret < 0) { - ntotal == (ssize_t)ret; + ntotal = (ssize_t)ret; break; } } diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index a92a860ad9..9320dafb0f 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -289,8 +289,6 @@ static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, uint8_t offset, uint16_t clearbits, uint16_t setbits); -static inline int stm32_i2c_sem_wait(FAR struct stm32_i2c_priv_s *priv); -static int stm32_i2c_sem_wait_noncancelable(FAR struct stm32_i2c_priv_s *priv); #ifdef CONFIG_STM32_I2C_DYNTIMEO static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs); @@ -505,33 +503,6 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, modifyreg16(priv->config->base + offset, clearbits, setbits); } -/************************************************************************************ - * Name: stm32_i2c_sem_wait - * - * Description: - * Take the exclusive access, waiting as necessary. May be interrupted by a - * signal. - * - ************************************************************************************/ - -static inline int stm32_i2c_sem_wait(FAR struct stm32_i2c_priv_s *priv) -{ - return nxsem_wait(&priv->sem_excl); -} - -/************************************************************************************ - * Name: stm32_i2c_sem_wait_noncancelable - * - * Description: - * Take the exclusive access, waiting as necessary - * - ************************************************************************************/ - -static int stm32_i2c_sem_wait_noncancelable(FAR struct stm32_i2c_priv_s *priv) -{ - return nxsem_wait_uninterruptible(&priv->sem_excl); -} - /************************************************************************************ * Name: stm32_i2c_tousecs * @@ -1604,7 +1575,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, /* Ensure that address or flags don't change meanwhile */ - ret = stm32_i2c_sem_wait(priv); + ret = nxsem_wait(&priv->sem_excl); if (ret < 0) { return ret; @@ -1826,7 +1797,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s *dev) /* Lock out other clients */ - ret = stm32_i2c_sem_wait_noncancelable(priv); + ret = nxsem_wait_uninterruptible(&priv->sem_excl); if (ret < 0) { return ret; diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index 7305cc4173..d3e61b58c9 100644 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -319,8 +319,6 @@ static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, uint8_t offset, uint16_t clearbits, uint16_t setbits); -static inline int stm32_i2c_sem_wait(FAR struct stm32_i2c_priv_s *priv); -static int stm32_i2c_sem_wait_noncancelable(FAR struct stm32_i2c_priv_s *priv); #ifdef CONFIG_STM32_I2C_DYNTIMEO static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs); @@ -514,33 +512,6 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, modifyreg16(priv->config->base + offset, clearbits, setbits); } -/************************************************************************************ - * Name: stm32_i2c_sem_wait - * - * Description: - * Take the exclusive access, waiting as necessary. May be interrupted by a - * signal. - * - ************************************************************************************/ - -static inline int stm32_i2c_sem_wait(FAR struct stm32_i2c_priv_s *priv) -{ - return nxsem_wait(&priv->sem_excl); -} - -/************************************************************************************ - * Name: stm32_i2c_sem_wait_noncancelable - * - * Description: - * Take the exclusive access, waiting as necessary - * - ************************************************************************************/ - -static int stm32_i2c_sem_wait_noncancelable(FAR struct stm32_i2c_priv_s *priv) -{ - return nxsem_wait_uninterruptible(&priv->sem_excl); -} - /************************************************************************************ * Name: stm32_i2c_tousecs * @@ -2055,7 +2026,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, /* Ensure that address or flags don't change meanwhile */ - ret = stm32_i2c_sem_wait(priv); + ret = nxsem_wait(&priv->sem_excl); if (ret < 0) { return ret; @@ -2292,7 +2263,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev) /* Lock out other clients */ - ret = stm32_i2c_sem_wait_noncancelable(priv); + ret = nxsem_wait_uninterruptible(&priv->sem_excl); if (ret < 0) { return ret; diff --git a/arch/arm/src/stm32/stm32_i2c_v2.c b/arch/arm/src/stm32/stm32_i2c_v2.c index a017fa66b2..77bec0402f 100644 --- a/arch/arm/src/stm32/stm32_i2c_v2.c +++ b/arch/arm/src/stm32/stm32_i2c_v2.c @@ -447,8 +447,6 @@ static inline void stm32_i2c_putreg32(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, uint8_t offset, uint32_t clearbits, uint32_t setbits); -static inline int stm32_i2c_sem_wait(FAR struct i2c_master_s *dev); -static int stm32_i2c_sem_wait_noncancelable(FAR struct i2c_master_s *dev); #ifdef CONFIG_STM32_I2C_DYNTIMEO static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs); #endif /* CONFIG_STM32_I2C_DYNTIMEO */ @@ -705,34 +703,6 @@ static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, modifyreg32(priv->config->base + offset, clearbits, setbits); } -/************************************************************************************ - * Name: stm32_i2c_sem_wait - * - * Description: - * Take the exclusive access, waiting as necessary. May be interrupted by a - * signal. - * - ************************************************************************************/ - -static inline int stm32_i2c_sem_wait(FAR struct i2c_master_s *dev) -{ - return nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); -} - -/************************************************************************************ - * Name: stm32_i2c_sem_wait_noncancelable - * - * Description: - * Take the exclusive access, waiting as necessary - * - ************************************************************************************/ - -static int stm32_i2c_sem_wait_noncancelable(FAR struct i2c_master_s *dev) -{ - return - nxsem_wait_uninterruptible(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); -} - /************************************************************************************ * Name: stm32_i2c_tousecs * @@ -2522,7 +2492,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, /* Ensure that address or flags don't change meanwhile */ - ret = stm32_i2c_sem_wait(dev); + ret = nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); if (ret >= 0) { ret = stm32_i2c_process(dev, msgs, count); @@ -2562,7 +2532,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev) /* Lock out other clients */ - ret = stm32_i2c_sem_wait_noncancelable(dev); + ret = nxsem_wait_uninterruptible(&priv->sem_excl); if (ret < 0) { return ret; diff --git a/arch/arm/src/stm32/stm32f40xxx_i2c.c b/arch/arm/src/stm32/stm32f40xxx_i2c.c index cd8b362ef7..b783d40a77 100644 --- a/arch/arm/src/stm32/stm32f40xxx_i2c.c +++ b/arch/arm/src/stm32/stm32f40xxx_i2c.c @@ -314,8 +314,6 @@ static inline void stm32_i2c_putreg(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, uint8_t offset, uint16_t clearbits, uint16_t setbits); -static inline int stm32_i2c_sem_wait(FAR struct stm32_i2c_priv_s *priv); -static int stm32_i2c_sem_wait_noncancelable(FAR struct stm32_i2c_priv_s *priv); #ifdef CONFIG_STM32_I2C_DYNTIMEO static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs); @@ -560,34 +558,6 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, modifyreg16(priv->config->base + offset, clearbits, setbits); } -/************************************************************************************ - * Name: stm32_i2c_sem_wait - * - * Description: - * Take the exclusive access, waiting as necessary. May be interrupted by a - * signal. - * - ************************************************************************************/ - -static inline int stm32_i2c_sem_wait(FAR struct stm32_i2c_priv_s *priv) -{ - return nxsem_wait(&priv->sem_excl); -} - -/************************************************************************************ - * Name: stm32_i2c_sem_wait_noncancelable - * - * Description: - * Take the exclusive access, waiting as necessary. May be interrupted by a - * signal. - * - ************************************************************************************/ - -static int stm32_i2c_sem_wait_noncancelable(FAR struct stm32_i2c_priv_s *priv) -{ - return nxsem_wait_uninterruptible(&priv->sem_excl); -} - /************************************************************************************ * Name: stm32_i2c_tousecs * @@ -2290,7 +2260,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, /* Ensure that address or flags don't change meanwhile */ - ret = stm32_i2c_sem_wait(priv); + ret = nxsem_wait(&priv->sem_excl); if (ret < 0) { return ret; @@ -2521,7 +2491,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s *dev) /* Lock out other clients */ - ret = stm32_i2c_sem_wait_noncancelable(priv); + ret = nxsem_wait_uninterruptible(&priv->sem_excl); if (ret < 0) { return ret; diff --git a/arch/arm/src/stm32f0l0g0/stm32_adc.c b/arch/arm/src/stm32f0l0g0/stm32_adc.c index fb2386f5de..4e19e3060b 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_adc.c +++ b/arch/arm/src/stm32f0l0g0/stm32_adc.c @@ -1345,7 +1345,6 @@ static void adc_reset(FAR struct adc_dev_s *dev) { FAR struct stm32_dev_s *priv = (FAR struct stm32_dev_s *)dev->ad_priv; irqstate_t flags; - int ret; ainfo("intf: %d\n", priv->intf); flags = enter_critical_section(); @@ -1359,8 +1358,7 @@ static void adc_reset(FAR struct adc_dev_s *dev) /* Only if this is the first initialzied ADC instance in the ADC block */ #ifdef HAVE_ADC_CMN_DATA - ret = adccmn_lock(priv, true); - if (ret < 0) + if (adccmn_lock(priv, true) < 0) { return; } @@ -1493,7 +1491,6 @@ static int adc_setup(FAR struct adc_dev_s *dev) static void adc_shutdown(FAR struct adc_dev_s *dev) { FAR struct stm32_dev_s *priv = (FAR struct stm32_dev_s *)dev->ad_priv; - int ret; /* Disable ADC */ @@ -1507,8 +1504,7 @@ static void adc_shutdown(FAR struct adc_dev_s *dev) #endif #ifdef HAVE_ADC_CMN_DATA - ret = adccmn_lock(priv, true); - if (ret < 0) + if (adccmn_lock(priv, true) < 0) { return; } diff --git a/arch/arm/src/stm32f0l0g0/stm32_i2c.c b/arch/arm/src/stm32f0l0g0/stm32_i2c.c index fa1beb916b..31e9ae51de 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_i2c.c +++ b/arch/arm/src/stm32f0l0g0/stm32_i2c.c @@ -451,7 +451,6 @@ static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, uint8_t offset, uint32_t clearbits, uint32_t setbits); static inline int stm32_i2c_sem_wait(FAR struct i2c_master_s *dev); -static int stm32_i2c_sem_wait_uninterruptble(FAR struct i2c_master_s *dev); #ifdef CONFIG_STM32F0L0G0_I2C_DYNTIMEO static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs); #endif /* CONFIG_STM32F0L0G0_I2C_DYNTIMEO */ @@ -718,20 +717,6 @@ static inline int stm32_i2c_sem_wait(FAR struct i2c_master_s *dev) return nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); } -/************************************************************************************ - * Name: stm32_i2c_sem_wait_uninterruptble - * - * Description: - * Take the exclusive access, waiting as necessary - * - ************************************************************************************/ - -static int stm32_i2c_sem_wait_uninterruptble(FAR struct i2c_master_s *dev) -{ - return - nxsem_wait_uninterruptible(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); -} - /************************************************************************************ * Name: stm32_i2c_tousecs * @@ -2557,7 +2542,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev) /* Lock out other clients */ - ret = stm32_i2c_sem_wait_uninterruptble(dev); + ret = nxsem_wait_uninterruptible(&priv->sem_excl); if (ret < 0) { return ret; diff --git a/arch/arm/src/stm32f7/stm32_i2c.c b/arch/arm/src/stm32f7/stm32_i2c.c index 757615b605..c7316be28b 100644 --- a/arch/arm/src/stm32f7/stm32_i2c.c +++ b/arch/arm/src/stm32f7/stm32_i2c.c @@ -485,8 +485,6 @@ static inline void stm32_i2c_putreg32(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, uint8_t offset, uint32_t clearbits, uint32_t setbits); -static inline int stm32_i2c_sem_wait(FAR struct i2c_master_s *dev); -static int stm32_i2c_sem_wait_noncancelable(FAR struct i2c_master_s *dev); #ifdef CONFIG_STM32F7_I2C_DYNTIMEO static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs); #endif /* CONFIG_STM32F7_I2C_DYNTIMEO */ @@ -743,35 +741,6 @@ static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, modifyreg32(priv->config->base + offset, clearbits, setbits); } -/************************************************************************************ - * Name: stm32_i2c_sem_wait - * - * Description: - * Take the exclusive access, waiting as necessary. May be interrupted by a - * signal. - * - ************************************************************************************/ - -static inline int stm32_i2c_sem_wait(FAR struct i2c_master_s *dev) -{ - return nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); -} - -/************************************************************************************ - * Name: stm32_i2c_sem_wait_noncancelable - * - * Description: - * Take the exclusive access, waiting as necessary. May be interrupted by a - * signal. - * - ************************************************************************************/ - -static int stm32_i2c_sem_wait_noncancelable(FAR struct i2c_master_s *dev) -{ - return - nxsem_wait_uninterruptible(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); -} - /************************************************************************************ * Name: stm32_i2c_tousecs * @@ -2561,7 +2530,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, /* Ensure that address or flags don't change meanwhile */ - ret = stm32_i2c_sem_wait(dev); + ret = nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); if (ret >= 0) { ret = stm32_i2c_process(dev, msgs, count); @@ -2601,7 +2570,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev) /* Lock out other clients */ - ret = stm32_i2c_sem_wait_noncancelable(dev); + ret = nxsem_wait_uninterruptible(&priv->sem_excl); if (ret < 0) { return ret; diff --git a/arch/arm/src/stm32h7/stm32_i2c.c b/arch/arm/src/stm32h7/stm32_i2c.c index 57ef60e216..a588e0ecb5 100644 --- a/arch/arm/src/stm32h7/stm32_i2c.c +++ b/arch/arm/src/stm32h7/stm32_i2c.c @@ -438,8 +438,6 @@ static inline void stm32_i2c_putreg32(FAR struct stm32_i2c_priv_s *priv, static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, uint8_t offset, uint32_t clearbits, uint32_t setbits); -static inline int stm32_i2c_sem_wait(FAR struct i2c_master_s *dev); -static int stm32_i2c_sem_wait_noncancelable(FAR struct i2c_master_s *dev); #ifdef CONFIG_STM32H7_I2C_DYNTIMEO static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs); #endif /* CONFIG_STM32H7_I2C_DYNTIMEO */ @@ -696,35 +694,6 @@ static inline void stm32_i2c_modifyreg32(FAR struct stm32_i2c_priv_s *priv, modifyreg32(priv->config->base + offset, clearbits, setbits); } -/************************************************************************************ - * Name: stm32_i2c_sem_wait - * - * Description: - * Take the exclusive access, waiting as necessary. May be interrupted by a - * signal. - * - ************************************************************************************/ - -static inline int stm32_i2c_sem_wait(FAR struct i2c_master_s *dev) -{ - return nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); -} - -/************************************************************************************ - * Name: stm32_i2c_sem_wait_noncancelable - * - * Description: - * Take the exclusive access, waiting as necessary. May be interrupted by a - * signal. - * - ************************************************************************************/ - -static int stm32_i2c_sem_wait_noncancelable(FAR struct i2c_master_s *dev) -{ - return - nxsem_wait_uninterruptible(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); -} - /************************************************************************************ * Name: stm32_i2c_tousecs * @@ -2506,7 +2475,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, /* Ensure that address or flags don't change meanwhile */ - ret = stm32_i2c_sem_wait(dev); + ret = nxsem_wait(&((struct stm32_i2c_inst_s *)dev)->priv->sem_excl); if (ret >= 0) { ret = stm32_i2c_process(dev, msgs, count); @@ -2546,7 +2515,7 @@ static int stm32_i2c_reset(FAR struct i2c_master_s * dev) /* Lock out other clients */ - ret = stm32_i2c_sem_wait_noncancelable(dev); + ret = nxsem_wait_uninterruptible(&priv->sem_excl); if (ret < 0) { return ret; diff --git a/arch/mips/src/pic32mx/pic32mx-gpio.c b/arch/mips/src/pic32mx/pic32mx-gpio.c index fbcc6a2fd2..d324fe0206 100644 --- a/arch/mips/src/pic32mx/pic32mx-gpio.c +++ b/arch/mips/src/pic32mx/pic32mx-gpio.c @@ -110,11 +110,6 @@ static inline bool pic32mx_outputhigh(uint16_t pinset) return ((pinset & GPIO_VALUE_MASK) != 0); } -static inline bool pic32mx_value(uint16_t pinset) -{ - return ((pinset & GPIO_VALUE_MASK) != GPIO_VALUE_ZERO); -} - static inline unsigned int pic32mx_portno(uint16_t pinset) { return ((pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT); diff --git a/arch/mips/src/pic32mx/pic32mx-lowconsole.c b/arch/mips/src/pic32mx/pic32mx-lowconsole.c index 53b37f2b0d..5037e76094 100644 --- a/arch/mips/src/pic32mx/pic32mx-lowconsole.c +++ b/arch/mips/src/pic32mx/pic32mx-lowconsole.c @@ -143,7 +143,7 @@ static inline void pic32mx_putreg(uintptr_t uart_base, unsigned int offset, * ****************************************************************************/ -#ifdef HAVE_UART_DEVICE +#ifdef HAVE_SERIAL_CONSOLE static inline uint32_t pic32mx_getreg(uintptr_t uart_base, unsigned int offset) { diff --git a/arch/mips/src/pic32mx/pic32mx-usbdev.c b/arch/mips/src/pic32mx/pic32mx-usbdev.c index 21c0ceb322..ba04317407 100644 --- a/arch/mips/src/pic32mx/pic32mx-usbdev.c +++ b/arch/mips/src/pic32mx/pic32mx-usbdev.c @@ -501,8 +501,6 @@ static inline struct pic32mx_ep_s * static inline void pic32mx_epunreserve(struct pic32mx_usbdev_s *priv, struct pic32mx_ep_s *privep); -static inline bool - pic32mx_epreserved(struct pic32mx_usbdev_s *priv, int epno); static void pic32mx_ep0configure(struct pic32mx_usbdev_s *priv); /* Endpoint operations ******************************************************/ @@ -3057,16 +3055,6 @@ pic32mx_epunreserve(struct pic32mx_usbdev_s *priv, struct pic32mx_ep_s *privep) leave_critical_section(flags); } -/**************************************************************************** - * Name: pic32mx_epreserved - ****************************************************************************/ - -static inline bool -pic32mx_epreserved(struct pic32mx_usbdev_s *priv, int epno) -{ - return ((priv->epavail & PIC32MX_ENDP_BIT(epno)) == 0); -} - /**************************************************************************** * Name: pic32mx_ep0configure ****************************************************************************/ diff --git a/arch/mips/src/pic32mz/pic32mz-gpio.c b/arch/mips/src/pic32mz/pic32mz-gpio.c index a19764b8d4..eca7088feb 100644 --- a/arch/mips/src/pic32mz/pic32mz-gpio.c +++ b/arch/mips/src/pic32mz/pic32mz-gpio.c @@ -121,11 +121,6 @@ static inline bool pic32mz_outputhigh(pinset_t pinset) return ((pinset & GPIO_VALUE_MASK) != 0); } -static inline bool pic32mz_value(pinset_t pinset) -{ - return ((pinset & GPIO_VALUE_MASK) != GPIO_VALUE_ZERO); -} - static inline unsigned int pic32mz_portno(pinset_t pinset) { return ((pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT); diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_analog.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_analog.c index dea2f42253..e8046ae870 100644 --- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_analog.c +++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_analog.c @@ -60,14 +60,6 @@ #define AUD_MCLK_EXT (0u<<16) /* External XTAL */ -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -inline void cxd56_audio_clock_enable(uint32_t clk, uint32_t div); -inline void cxd56_audio_clock_disable(void); -inline bool cxd56_audio_clock_is_enabled(void); - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/boards/arm/imx6/sabre-6quad/configs/smp/defconfig b/boards/arm/imx6/sabre-6quad/configs/smp/defconfig index 9283264fd7..f871b91a12 100644 --- a/boards/arm/imx6/sabre-6quad/configs/smp/defconfig +++ b/boards/arm/imx6/sabre-6quad/configs/smp/defconfig @@ -63,6 +63,7 @@ CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_NSH_CXXINITIALIZE=y CONFIG_SYSTEM_TASKSET=y CONFIG_TESTING_OSTEST=y +CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y CONFIG_TESTING_SMP=y CONFIG_UART1_SERIAL_CONSOLE=y CONFIG_USER_ENTRYPOINT="nsh_main" diff --git a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c index 66a2565f46..2dc6d8c81e 100644 --- a/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c +++ b/boards/arm/lpc214x/mcu123-lpc214x/src/lpc2148_spi1.c @@ -117,7 +117,7 @@ static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid); #ifdef CONFIG_SPI_CMDDATA static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); #endif -static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t ch); +static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t ch); static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords); static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, @@ -359,7 +359,7 @@ static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * ****************************************************************************/ -static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) +static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd) { register uint16_t regval; diff --git a/boards/arm/str71x/olimex-strp711/src/str71_spi.c b/boards/arm/str71x/olimex-strp711/src/str71_spi.c index 77c7879d28..a05e02d91d 100644 --- a/boards/arm/str71x/olimex-strp711/src/str71_spi.c +++ b/boards/arm/str71x/olimex-strp711/src/str71_spi.c @@ -413,7 +413,7 @@ static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid); static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); #endif -static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd); +static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd); static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t buflen); static void spi_recvblock(FAR struct spi_dev_s *dev, @@ -784,7 +784,7 @@ static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * ****************************************************************************/ -static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) +static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd) { FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev; diff --git a/drivers/mmcsd/mmcsd_spi.c b/drivers/mmcsd/mmcsd_spi.c index 44cf2bdcf3..b0ad4cf591 100644 --- a/drivers/mmcsd/mmcsd_spi.c +++ b/drivers/mmcsd/mmcsd_spi.c @@ -1935,7 +1935,7 @@ static void mmcsd_mediachanged(void *arg) ret = mmcsd_semtake(slot); if (ret < 0) { - return ret; + return; } oldstate = slot->state; diff --git a/drivers/wireless/gs2200m.c b/drivers/wireless/gs2200m.c index 45a60b3d62..2c565b6531 100644 --- a/drivers/wireless/gs2200m.c +++ b/drivers/wireless/gs2200m.c @@ -724,7 +724,7 @@ static ssize_t gs2200m_read(FAR struct file *filep, FAR char *buffer, ASSERT(1 == len); - ret = nxsem_wait(dev); + ret = nxsem_wait(&dev->dev_sem); if (ret < 0) { /* Return if a signal is received or if the the task was canceled diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.h b/drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.h index 3b50b8d460..124868b9e1 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.h +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_utils.h @@ -67,13 +67,13 @@ int bcmf_sem_wait(sem_t *sem, unsigned int timeout_ms); dq_entry_t *bcmf_dqueue_pop_tail(dq_queue_t *queue); void bcmf_dqueue_push(dq_queue_t *queue, dq_entry_t *entry); -static inline uint16_t bcmf_getle16(uint16_t *val) +static inline uint16_t bcmf_getle16(void *val) { uint8_t *valb = (uint8_t *)val; return (uint16_t)valb[0] << 8 | (uint16_t)valb[1]; } -static inline uint16_t bcmf_getle32(uint32_t *val) +static inline uint32_t bcmf_getle32(void *val) { uint16_t *valw = (uint16_t *)val; return (uint32_t)bcmf_getle16(valw) << 16 | bcmf_getle16(valw + 1); diff --git a/drivers/wireless/ieee80211/bcm43xxx/mmc_sdio.c b/drivers/wireless/ieee80211/bcm43xxx/mmc_sdio.c index b514bb8b91..3724bfda9d 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/mmc_sdio.c +++ b/drivers/wireless/ieee80211/bcm43xxx/mmc_sdio.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -131,6 +132,7 @@ int sdio_io_rw_direct(FAR struct sdio_dev_s *dev, bool write, { union sdio_cmd5x arg; struct sdio_resp_R5 resp; + uint32_t data; int ret; /* Setup CMD52 argument */ @@ -154,7 +156,7 @@ int sdio_io_rw_direct(FAR struct sdio_dev_s *dev, bool write, /* Send CMD52 command */ sdio_sendcmdpoll(dev, SD_ACMD52, arg.value); - ret = SDIO_RECVR5(dev, SD_ACMD52, (uint32_t *)&resp); + ret = SDIO_RECVR5(dev, SD_ACMD52, &data); if (ret != OK) { @@ -162,6 +164,8 @@ int sdio_io_rw_direct(FAR struct sdio_dev_s *dev, bool write, return ret; } + memcpy(&resp, &data, sizeof(resp)); + /* Check for errors */ if (resp.flags.error) @@ -191,6 +195,7 @@ int sdio_io_rw_extended(FAR struct sdio_dev_s *dev, bool write, { union sdio_cmd5x arg; struct sdio_resp_R5 resp; + uint32_t data; int ret; sdio_eventset_t wkupevent; @@ -233,15 +238,15 @@ int sdio_io_rw_extended(FAR struct sdio_dev_s *dev, bool write, if ((SDIO_CAPABILITIES(dev) & SDIO_CAPS_DMABEFOREWRITE) != 0) { SDIO_DMASENDSETUP(dev, buf, blocklen * nblocks); - SDIO_SENDCMD(dev, SD_ACMD53, (uint32_t)arg.value); + SDIO_SENDCMD(dev, SD_ACMD53, arg.value); wkupevent = SDIO_EVENTWAIT(dev, SDIO_CMD53_TIMEOUT_MS); - ret = SDIO_RECVR5(dev, SD_ACMD53, (uint32_t *)&resp); + ret = SDIO_RECVR5(dev, SD_ACMD53, &data); } else { - sdio_sendcmdpoll(dev, SD_ACMD53, (uint32_t)arg.value); - ret = SDIO_RECVR5(dev, SD_ACMD53, (uint32_t *)&resp); + sdio_sendcmdpoll(dev, SD_ACMD53, arg.value); + ret = SDIO_RECVR5(dev, SD_ACMD53, &data); SDIO_DMASENDSETUP(dev, buf, blocklen * nblocks); wkupevent = SDIO_EVENTWAIT(dev, SDIO_CMD53_TIMEOUT_MS); @@ -251,10 +256,10 @@ int sdio_io_rw_extended(FAR struct sdio_dev_s *dev, bool write, { wlinfo("prep read %d\n", blocklen * nblocks); SDIO_DMARECVSETUP(dev, buf, blocklen * nblocks); - SDIO_SENDCMD(dev, SD_ACMD53, (uint32_t)arg.value); + SDIO_SENDCMD(dev, SD_ACMD53, arg.value); wkupevent = SDIO_EVENTWAIT(dev, SDIO_CMD53_TIMEOUT_MS); - ret = SDIO_RECVR5(dev, SD_ACMD53, (uint32_t *)&resp); + ret = SDIO_RECVR5(dev, SD_ACMD53, &data); } wlinfo("Transaction ends\n"); @@ -262,7 +267,7 @@ int sdio_io_rw_extended(FAR struct sdio_dev_s *dev, bool write, /* There may not be a response to this, so don't look for one */ - SDIO_RECVR1(dev, SD_ACMD52ABRT, (uint32_t *)&resp); + SDIO_RECVR1(dev, SD_ACMD52ABRT, &data); if (ret != OK) { @@ -270,6 +275,8 @@ int sdio_io_rw_extended(FAR struct sdio_dev_s *dev, bool write, return ret; } + memcpy(&resp, &data, sizeof(resp)); + /* Check for errors */ if (wkupevent & SDIOWAIT_TIMEOUT) diff --git a/drivers/wireless/lpwan/sx127x/sx127x.c b/drivers/wireless/lpwan/sx127x/sx127x.c index 1dfabe867e..be02f1b608 100644 --- a/drivers/wireless/lpwan/sx127x/sx127x.c +++ b/drivers/wireless/lpwan/sx127x/sx127x.c @@ -144,7 +144,7 @@ /* Some assertions */ #ifdef CONFIG_LPWAN_SX127X_FSKOOK -# warning OOK support is not complete, RX+TX doesn't work yet! +# warning OOK support is not complete, RX+TX does not work yet! # if CONFIG_LPWAN_SX127X_RXFIFO_DATA_LEN > SX127X_FOM_FIFO_LEN # warning RX data length limited by chip RX FIFO size (FSK/OOK = 64, LORA = 256) # endif diff --git a/fs/partition/fs_ptable.c b/fs/partition/fs_ptable.c index c61ca45bf3..8d2cf5ad4a 100644 --- a/fs/partition/fs_ptable.c +++ b/fs/partition/fs_ptable.c @@ -74,6 +74,24 @@ struct ptable_s struct ptable_entry_s entries[]; }; +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static int read_partition_block(FAR struct partition_state_s *state, + FAR void *buffer, size_t startblock, + size_t nblocks) +{ + if (state->blk) + { + return state->blk->u.i_bops->read(state->blk, buffer, startblock, nblocks); + } + else + { + return state->mtd->bread(state->mtd, startblock, nblocks, buffer); + } +} + /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/fs/partition/partition.h b/fs/partition/partition.h index df3dbf145f..e46b209662 100644 --- a/fs/partition/partition.h +++ b/fs/partition/partition.h @@ -59,24 +59,6 @@ struct partition_state_s size_t erasesize; }; -/**************************************************************************** - * Public Inline Functions - ****************************************************************************/ - -static inline int read_partition_block(FAR struct partition_state_s *state, - FAR void *buffer, size_t startblock, - size_t nblocks) -{ - if (state->blk) - { - return state->blk->u.i_bops->read(state->blk, buffer, startblock, nblocks); - } - else - { - return state->mtd->bread(state->mtd, startblock, nblocks, buffer); - } -} - #endif /* CONFIG_DISABLE_MOUNTPOINT */ #endif /* __FS_PARTITION_PARTITION_H */ diff --git a/net/local/local_netpoll.c b/net/local/local_netpoll.c index 8506301b2b..9f6877010c 100644 --- a/net/local/local_netpoll.c +++ b/net/local/local_netpoll.c @@ -261,7 +261,6 @@ int local_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) else { fds->priv = shadowfds; - ret = OK; } } break; @@ -298,7 +297,6 @@ int local_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) ret = OK; break; } -#endif return ret; @@ -306,6 +304,7 @@ pollerr: fds->revents |= POLLERR; nxsem_post(fds->sem); return OK; +#endif } /**************************************************************************** @@ -327,14 +326,13 @@ pollerr: int local_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) { FAR struct local_conn_s *conn; - int status = OK; - int ret = -ENOSYS; + int ret = OK; conn = (FAR struct local_conn_s *)psock->s_conn; if (conn->lc_proto == SOCK_DGRAM) { - return ret; + return -ENOSYS; } #ifdef CONFIG_NET_LOCAL_STREAM @@ -354,6 +352,7 @@ int local_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) case (POLLIN | POLLOUT): { FAR struct pollfd *shadowfds = fds->priv; + int ret2; if (shadowfds == NULL) { @@ -363,15 +362,10 @@ int local_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) /* Teardown for both shadow pollfds. */ ret = file_poll(&conn->lc_infile, &shadowfds[0], false); - if (ret < 0) + ret2 = file_poll(&conn->lc_outfile, &shadowfds[1], false); + if (ret2 < 0) { - status = ret; - } - - ret = file_poll(&conn->lc_outfile, &shadowfds[1], false); - if (ret < 0) - { - status = ret; + ret = ret2; } fds->revents |= shadowfds[0].revents | shadowfds[1].revents; @@ -387,7 +381,7 @@ int local_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) return OK; } - status = file_poll(&conn->lc_infile, fds, false); + ret = file_poll(&conn->lc_infile, fds, false); } break; @@ -398,7 +392,7 @@ int local_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) return OK; } - status = file_poll(&conn->lc_outfile, fds, false); + ret = file_poll(&conn->lc_outfile, fds, false); } break; @@ -407,7 +401,7 @@ int local_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) } #endif - return status; + return ret; } #endif /* HAVE_LOCAL_POLL */ diff --git a/wireless/ieee802154/mac802154_internal.h b/wireless/ieee802154/mac802154_internal.h index bfd57116c8..d6b3cd56e5 100644 --- a/wireless/ieee802154/mac802154_internal.h +++ b/wireless/ieee802154/mac802154_internal.h @@ -781,7 +781,7 @@ static inline void mac802154_setrxonidle(FAR struct ieee802154_privmac_s *priv, } static inline void mac802154_setdevmode(FAR struct ieee802154_privmac_s *priv, - enum ieee802154_devmode_e mode) + uint8_t mode) { priv->devmode = mode; priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_DEVMODE,