Remove the unnessary empty line after label
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
6e490759d6
commit
bdeaea3742
70 changed files with 208 additions and 484 deletions
|
|
@ -485,28 +485,21 @@ static int cxd56_geofence_initialize(struct cxd56_geofence_dev_s *dev)
|
|||
static ssize_t cxd56_geofence_read(struct file *filep, char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
|
||||
/* Check argument */
|
||||
|
||||
if (!buffer)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto _err;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (len == 0)
|
||||
{
|
||||
ret = 0;
|
||||
goto _err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* fw_gd_readbuffer returns copied data size or negative error code */
|
||||
|
||||
ret = fw_gd_readbuffer(CXD56_CPU1_DEV_GEOFENCE, 0, buffer, len);
|
||||
|
||||
_err:
|
||||
return ret;
|
||||
return fw_gd_readbuffer(CXD56_CPU1_DEV_GEOFENCE, 0, buffer, len);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -653,33 +646,33 @@ static int cxd56_geofence_register(const char *devpath)
|
|||
if (ret < 0)
|
||||
{
|
||||
gnsserr("Failed to initialize geofence device!\n");
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
ret = register_driver(devpath, &g_geofencefops, 0666, priv);
|
||||
if (ret < 0)
|
||||
{
|
||||
gnsserr("Failed to register driver: %d\n", ret);
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
ret = cxd56_cpu1siginit(CXD56_CPU1_DEV_GEOFENCE, priv);
|
||||
if (ret < 0)
|
||||
{
|
||||
gnsserr("Failed to initialize ICC for GPS CPU: %d\n", ret);
|
||||
goto _err2;
|
||||
goto err1;
|
||||
}
|
||||
|
||||
cxd56_cpu1sigregisterhandler(CXD56_CPU1_DEV_GEOFENCE,
|
||||
cxd56_geofence_sighandler);
|
||||
|
||||
gnssinfo("GEOFENCE driver loaded successfully!\n");
|
||||
|
||||
return ret;
|
||||
|
||||
_err2:
|
||||
err1:
|
||||
unregister_driver(devpath);
|
||||
_err0:
|
||||
|
||||
err0:
|
||||
kmm_free(priv);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1511,14 +1511,14 @@ static int cxd56_gnss_set_signal(struct file *filep, unsigned long arg)
|
|||
checksig->pid == pid)
|
||||
{
|
||||
checksig->enable = 0;
|
||||
goto _success;
|
||||
goto success;
|
||||
}
|
||||
}
|
||||
|
||||
if (sig == NULL)
|
||||
{
|
||||
ret = -ENOENT;
|
||||
goto _err;
|
||||
goto err;
|
||||
}
|
||||
|
||||
fw_gd_setnotifymask(setting->gnsssig, FALSE);
|
||||
|
|
@ -1530,8 +1530,8 @@ static int cxd56_gnss_set_signal(struct file *filep, unsigned long arg)
|
|||
sig->info.signo = setting->signo;
|
||||
sig->info.data = setting->data;
|
||||
|
||||
_success:
|
||||
_err:
|
||||
success:
|
||||
err:
|
||||
nxsem_post(&priv->devsem);
|
||||
#endif /* CONFIG_CXD56_GNSS_NSIGNALRECEIVERS != 0 */
|
||||
|
||||
|
|
@ -2138,26 +2138,26 @@ cxd56_gnss_read_cep_file(struct file *fp, int32_t offset,
|
|||
if (fp == NULL)
|
||||
{
|
||||
ret = -ENOENT;
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
buf = (char *)kmm_malloc(len);
|
||||
if (buf == NULL)
|
||||
{
|
||||
ret = -ENOMEM;
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
ret = file_seek(fp, offset, SEEK_SET);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto _err1;
|
||||
goto err1;
|
||||
}
|
||||
|
||||
ret = file_read(fp, buf, len);
|
||||
if (ret <= 0)
|
||||
{
|
||||
goto _err1;
|
||||
goto err1;
|
||||
}
|
||||
|
||||
*retval = ret;
|
||||
|
|
@ -2169,9 +2169,9 @@ cxd56_gnss_read_cep_file(struct file *fp, int32_t offset,
|
|||
* sequence.
|
||||
*/
|
||||
|
||||
_err1:
|
||||
err1:
|
||||
kmm_free(buf);
|
||||
_err0:
|
||||
err0:
|
||||
*retval = ret;
|
||||
cxd56_cpu1sigsend(CXD56_CPU1_DATA_TYPE_CEP, 0);
|
||||
|
||||
|
|
@ -2204,14 +2204,14 @@ static void cxd56_gnss_read_backup_file(int *retval)
|
|||
if (buf == NULL)
|
||||
{
|
||||
ret = -ENOMEM;
|
||||
goto _err;
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = file_open(&file, CONFIG_CXD56_GNSS_BACKUP_FILENAME, O_RDONLY);
|
||||
if (ret < 0)
|
||||
{
|
||||
kmm_free(buf);
|
||||
goto _err;
|
||||
goto err;
|
||||
}
|
||||
|
||||
do
|
||||
|
|
@ -2238,7 +2238,7 @@ static void cxd56_gnss_read_backup_file(int *retval)
|
|||
|
||||
/* Notify the termination of backup sequence by write zero length data */
|
||||
|
||||
_err:
|
||||
err:
|
||||
*retval = ret;
|
||||
cxd56_cpu1sigsend(CXD56_CPU1_DATA_TYPE_BKUPFILE, 0);
|
||||
}
|
||||
|
|
@ -2458,13 +2458,10 @@ static int cxd56_gnss_cpufifo_api(struct file *filep, unsigned int api,
|
|||
*/
|
||||
|
||||
_warn("Cannot wait GNSS semaphore %d\n", ret);
|
||||
goto _err;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = priv->apiret;
|
||||
|
||||
_err:
|
||||
return ret;
|
||||
return priv->apiret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -2608,7 +2605,7 @@ static int cxd56_gnss_open(struct file *filep)
|
|||
ret = nxsem_init(&priv->syncsem, 0, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
nxsem_set_protocol(&priv->syncsem, SEM_PRIO_NONE);
|
||||
|
|
@ -2625,13 +2622,13 @@ static int cxd56_gnss_open(struct file *filep)
|
|||
|
||||
if (ret < 0)
|
||||
{
|
||||
goto _err1;
|
||||
goto err1;
|
||||
}
|
||||
|
||||
ret = fw_pm_startcpu(CXD56_GNSS_GPS_CPUID, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto _err2;
|
||||
goto err2;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_CXD56_GNSS_HOT_SLEEP
|
||||
|
|
@ -2646,31 +2643,31 @@ static int cxd56_gnss_open(struct file *filep)
|
|||
ret = cxd56_gnss_wait_notify(&priv->syncsem, 5);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto _err2;
|
||||
goto err2;
|
||||
}
|
||||
|
||||
ret = fw_gd_writebuffer(CXD56_CPU1_DATA_TYPE_INFO, 0,
|
||||
&priv->shared_info, sizeof(priv->shared_info));
|
||||
if (ret < 0)
|
||||
{
|
||||
goto _err2;
|
||||
goto err2;
|
||||
}
|
||||
|
||||
nxsem_destroy(&priv->syncsem);
|
||||
}
|
||||
|
||||
priv->num_open++;
|
||||
goto _success;
|
||||
goto success;
|
||||
|
||||
_err2:
|
||||
err2:
|
||||
#ifndef CONFIG_CXD56_GNSS_HOT_SLEEP
|
||||
fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_HOT_ENABLE);
|
||||
#endif
|
||||
fw_pm_sleepcpu(CXD56_GNSS_GPS_CPUID, PM_SLEEP_MODE_COLD);
|
||||
_err1:
|
||||
err1:
|
||||
nxsem_destroy(&priv->syncsem);
|
||||
_err0:
|
||||
_success:
|
||||
err0:
|
||||
success:
|
||||
nxsem_post(&priv->devsem);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -2718,7 +2715,7 @@ static int cxd56_gnss_close(struct file *filep)
|
|||
}
|
||||
}
|
||||
|
||||
errout:
|
||||
errout:
|
||||
nxsem_post(&priv->devsem);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -2749,12 +2746,12 @@ static ssize_t cxd56_gnss_read(struct file *filep, char *buffer,
|
|||
if (!buffer)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto _err;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (len == 0)
|
||||
{
|
||||
goto _success;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* setect data type */
|
||||
|
|
@ -2763,7 +2760,7 @@ static ssize_t cxd56_gnss_read(struct file *filep, char *buffer,
|
|||
if (type < 0)
|
||||
{
|
||||
ret = -ESPIPE;
|
||||
goto _err;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (type == CXD56_CPU1_DATA_TYPE_GNSS)
|
||||
|
|
@ -2787,8 +2784,7 @@ static ssize_t cxd56_gnss_read(struct file *filep, char *buffer,
|
|||
|
||||
ret = fw_gd_readbuffer(type, offset, buffer, len);
|
||||
|
||||
_err:
|
||||
_success:
|
||||
out:
|
||||
filep->f_pos = 0;
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -3023,14 +3019,14 @@ static int cxd56_gnss_register(const char *devpath)
|
|||
if (ret < 0)
|
||||
{
|
||||
gnsserr("Failed to initialize gnss devsem!\n");
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
ret = nxsem_init(&priv->apiwait, 0, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
gnsserr("Failed to initialize gnss apiwait!\n");
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
nxsem_set_protocol(&priv->apiwait, SEM_PRIO_NONE);
|
||||
|
|
@ -3039,21 +3035,21 @@ static int cxd56_gnss_register(const char *devpath)
|
|||
if (ret < 0)
|
||||
{
|
||||
gnsserr("Failed to initialize gnss ioctllock!\n");
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
ret = cxd56_gnss_initialize(priv);
|
||||
if (ret < 0)
|
||||
{
|
||||
gnsserr("Failed to initialize gnss device!\n");
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
ret = register_driver(devpath, &g_gnssfops, 0666, priv);
|
||||
if (ret < 0)
|
||||
{
|
||||
gnsserr("Failed to register driver: %d\n", ret);
|
||||
goto _err0;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(devsig_table) / sizeof(devsig_table[0]); i++)
|
||||
|
|
@ -3063,7 +3059,7 @@ static int cxd56_gnss_register(const char *devpath)
|
|||
{
|
||||
gnsserr("Failed to initialize ICC for GPS CPU: %d,%d\n", ret,
|
||||
devsig_table[i].sigtype);
|
||||
goto _err2;
|
||||
goto err1;
|
||||
}
|
||||
|
||||
cxd56_cpu1sigregisterhandler(devsig_table[i].sigtype,
|
||||
|
|
@ -3071,13 +3067,12 @@ static int cxd56_gnss_register(const char *devpath)
|
|||
}
|
||||
|
||||
gnssinfo("GNSS driver loaded successfully!\n");
|
||||
|
||||
return ret;
|
||||
|
||||
_err2:
|
||||
err1:
|
||||
unregister_driver(devpath);
|
||||
|
||||
_err0:
|
||||
err0:
|
||||
kmm_free(priv);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2909,6 +2909,7 @@ static int cxd56_sdio_dmarecvsetup(struct sdio_dev_s *dev,
|
|||
|
||||
cxd56_sample(priv, SAMPLENDX_AFTER_SETUP);
|
||||
return OK;
|
||||
|
||||
error:
|
||||
|
||||
/* Free allocated align buffer */
|
||||
|
|
@ -3034,6 +3035,7 @@ static int cxd56_sdio_dmasendsetup(struct sdio_dev_s *dev,
|
|||
cxd56_configxfrints(priv, SDHCI_DMADONE_INTS);
|
||||
|
||||
return OK;
|
||||
|
||||
error:
|
||||
|
||||
/* Free allocated align buffer */
|
||||
|
|
|
|||
|
|
@ -579,7 +579,6 @@ void lc823450_dvfs_exit_idle(int irq)
|
|||
lc823450_dvfs_set_div(_dvfs_cur_idx, 0);
|
||||
|
||||
exit_with_error:
|
||||
|
||||
if (0 == _dvfs_cpu_is_active[me])
|
||||
{
|
||||
/* In case of idle to active transition
|
||||
|
|
|
|||
|
|
@ -1199,7 +1199,6 @@ static int up_hs_send(struct uart_dev_s *dev, const char *buf, int buflen)
|
|||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
|
||||
retry:
|
||||
|
||||
nxsem_wait(&priv->txdma_wait);
|
||||
|
||||
/* If buflen <= FIFO space, write it by PIO. */
|
||||
|
|
|
|||
|
|
@ -319,7 +319,6 @@ static int epbuf_write(int epnum, void *buf, size_t len)
|
|||
privep = &g_usbdev.eplist[epnum];
|
||||
|
||||
cont:
|
||||
|
||||
if (epnum == 0)
|
||||
{
|
||||
while (!(getreg32(USB_EPCTRL(epnum)) & USB_EPCTRL_EMPTYI) &&
|
||||
|
|
|
|||
|
|
@ -519,7 +519,7 @@ struct phyplus_tim_dev_s *phyplus_tim_init(int timer)
|
|||
default:
|
||||
{
|
||||
tmrerr("ERROR: unsupported TIMER %d\n", timer);
|
||||
goto errout;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -532,11 +532,10 @@ struct phyplus_tim_dev_s *phyplus_tim_init(int timer)
|
|||
else
|
||||
{
|
||||
tmrerr("ERROR: TIMER %d is already in use\n", timer);
|
||||
tim = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
syslog(LOG_ERR, "phyplus_tim_init 2\n");
|
||||
errout:
|
||||
return (struct phyplus_tim_dev_s *)tim;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2647,7 +2647,6 @@ static sdio_eventset_t stm32_eventwait(struct sdio_dev_s *dev)
|
|||
/* Disable event-related interrupts */
|
||||
|
||||
errout_with_waitints:
|
||||
|
||||
stm32_configwaitints(priv, 0, 0, 0);
|
||||
#ifdef CONFIG_STM32_SDIO_DMA
|
||||
priv->xfrflags = 0;
|
||||
|
|
|
|||
|
|
@ -2904,7 +2904,6 @@ static sdio_eventset_t stm32_eventwait(struct sdio_dev_s *dev)
|
|||
/* Disable event-related interrupts */
|
||||
|
||||
errout_with_waitints:
|
||||
|
||||
stm32_configwaitints(priv, 0, 0, 0);
|
||||
#ifdef CONFIG_STM32F7_SDMMC_DMA
|
||||
priv->xfrflags = 0;
|
||||
|
|
|
|||
|
|
@ -3006,7 +3006,6 @@ static sdio_eventset_t stm32_eventwait(struct sdio_dev_s *dev)
|
|||
/* Disable event-related interrupts */
|
||||
|
||||
errout_with_waitints:
|
||||
|
||||
stm32_configwaitints(priv, 0, 0, 0);
|
||||
|
||||
leave_critical_section(flags);
|
||||
|
|
|
|||
|
|
@ -2673,7 +2673,6 @@ static sdio_eventset_t stm32_eventwait(struct sdio_dev_s *dev)
|
|||
/* Disable event-related interrupts */
|
||||
|
||||
errout_with_waitints:
|
||||
|
||||
stm32_configwaitints(priv, 0, 0, 0);
|
||||
#ifdef CONFIG_STM32L4_SDMMC_DMA
|
||||
priv->xfrflags = 0;
|
||||
|
|
|
|||
|
|
@ -1663,7 +1663,6 @@ int tivacan_handle_errors(struct can_dev_s *dev)
|
|||
canmod->base + TIVA_CAN_OFFSET_STS);
|
||||
|
||||
save_regs_and_return:
|
||||
|
||||
#endif /* CONFIG_CAN_ERRORS */
|
||||
|
||||
/* Save contents of CANSTS and CANERR for other functions to use
|
||||
|
|
|
|||
|
|
@ -3400,8 +3400,7 @@ static int rx65n_phyinit(FAR struct rx65n_ethmac_s *priv)
|
|||
|
||||
if (count > ETHER_CFG_PHY_DELAY_RESET)
|
||||
{
|
||||
ret = -ETIMEDOUT;
|
||||
goto error_with_reset_timeout;
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
priv->mbps100 = 0;
|
||||
|
|
@ -3434,8 +3433,7 @@ static int rx65n_phyinit(FAR struct rx65n_ethmac_s *priv)
|
|||
|
||||
if (count > ETHER_PHY_STATUS_CHECK_DELAY)
|
||||
{
|
||||
ret = -ETIMEDOUT;
|
||||
goto error_with_auto_neg_timeout;
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RX65N_EMAC0_PHYSR_ALTCONFIG
|
||||
|
|
@ -3463,11 +3461,9 @@ static int rx65n_phyinit(FAR struct rx65n_ethmac_s *priv)
|
|||
priv->mbps100 = 1;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
error_with_reset_timeout:
|
||||
error_with_auto_neg_timeout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7649,8 +7649,8 @@ errout_with_xfrinfo:
|
|||
ed->xfrinfo = NULL;
|
||||
}
|
||||
while (0);
|
||||
errout_with_sem:
|
||||
|
||||
errout_with_sem:
|
||||
/* rx65n_usbhost_givesem(&priv->exclsem); */
|
||||
|
||||
return nbytes;
|
||||
|
|
|
|||
|
|
@ -811,7 +811,6 @@ static int mpi_mult_mpi_overlong(struct esp32c3_mpi_s *Z,
|
|||
|
||||
cleanup:
|
||||
esp32c3_mpi_free(&ztemp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -848,6 +847,7 @@ static int mpi_mult_mpi_failover_mod_mult(struct esp32c3_mpi_s *Z,
|
|||
esp32c3_mpi_read_result_hw_op(Z, z_words);
|
||||
|
||||
Z->s = X->s * Y->s;
|
||||
|
||||
cleanup:
|
||||
esp32c3_mpi_disable_hardware_hw_op();
|
||||
return ret;
|
||||
|
|
@ -983,7 +983,6 @@ static int mpi_write_hlp(struct esp32c3_mpi_s *X, int radix,
|
|||
*p += length;
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1447,7 +1446,6 @@ int esp32c3_mpi_copy(struct esp32c3_mpi_s *X,
|
|||
memcpy(X->p, Y->p, i * CIL);
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1604,7 +1602,6 @@ int esp32c3_mpi_lset(struct esp32c3_mpi_s *X, int32_t z)
|
|||
X->s = (z < 0) ? -1 : 1;
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1678,7 +1675,6 @@ int esp32c3_mpi_set_bit(struct esp32c3_mpi_s *X,
|
|||
X->p[off] |= (uint32_t) val << idx;
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1863,9 +1859,7 @@ int esp32c3_mpi_read_string(struct esp32c3_mpi_s *X,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
esp32c3_mpi_free(&T);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2001,9 +1995,7 @@ int esp32c3_mpi_write_string(const struct esp32c3_mpi_s *X, int radix,
|
|||
*olen = p - buf;
|
||||
|
||||
cleanup:
|
||||
|
||||
esp32c3_mpi_free(&T);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2059,7 +2051,6 @@ int esp32c3_mpi_read_binary(struct esp32c3_mpi_s *X,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2193,7 +2184,6 @@ int esp32c3_mpi_shift_l(struct esp32c3_mpi_s *X, size_t count)
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2619,7 +2609,6 @@ int esp32c3_mpi_add_abs(struct esp32c3_mpi_s *X,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2702,9 +2691,7 @@ int esp32c3_mpi_sub_abs(struct esp32c3_mpi_s *X,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
esp32c3_mpi_free(&TB);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2755,7 +2742,6 @@ int esp32c3_mpi_add_mpi(struct esp32c3_mpi_s *X,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2806,7 +2792,6 @@ int esp32c3_mpi_sub_mpi(struct esp32c3_mpi_s *X,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -3166,7 +3151,6 @@ int esp32c3_mpi_div_mpi(struct esp32c3_mpi_s *Q,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
esp32c3_mpi_free(&X); esp32c3_mpi_free(&Y); esp32c3_mpi_free(&Z);
|
||||
esp32c3_mpi_free(&T1); esp32c3_mpi_free(&T2);
|
||||
|
||||
|
|
@ -3250,7 +3234,6 @@ int esp32c3_mpi_mod_mpi(struct esp32c3_mpi_s *R,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -3583,7 +3566,6 @@ int esp32c3_mpi_exp_mod(struct esp32c3_mpi_s *X,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
for (i = (one << (wsize - 1)); i < (one << wsize); i++)
|
||||
{
|
||||
esp32c3_mpi_free(&W[i]);
|
||||
|
|
@ -3673,9 +3655,7 @@ int esp32c3_mpi_gcd(struct esp32c3_mpi_s *G,
|
|||
ESP32C3_MPI_CHK(esp32c3_mpi_copy(G, &TB), cleanup);
|
||||
|
||||
cleanup:
|
||||
|
||||
esp32c3_mpi_free(&TG); esp32c3_mpi_free(&TA); esp32c3_mpi_free(&TB);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -3854,7 +3834,6 @@ int esp32c3_mpi_inv_mod(struct esp32c3_mpi_s *X,
|
|||
ESP32C3_MPI_CHK(esp32c3_mpi_copy(X, &V1), cleanup);
|
||||
|
||||
cleanup:
|
||||
|
||||
esp32c3_mpi_free(&TA);
|
||||
esp32c3_mpi_free(&TU);
|
||||
esp32c3_mpi_free(&U1);
|
||||
|
|
|
|||
|
|
@ -706,7 +706,6 @@ static int esp32c3_rsa_deduce_primes(struct esp32c3_mpi_s const *N,
|
|||
ret = ESP32C3_ERR_MPI_BAD_INPUT_DATA;
|
||||
|
||||
cleanup:
|
||||
|
||||
esp32c3_mpi_free(&K);
|
||||
esp32c3_mpi_free(&T);
|
||||
return ret;
|
||||
|
|
@ -772,7 +771,6 @@ static int esp32c3_rsa_deduce_private_exponent(struct esp32c3_mpi_s const *P,
|
|||
ESP32C3_MPI_CHK(esp32c3_mpi_inv_mod(D, E, &K), cleanup);
|
||||
|
||||
cleanup:
|
||||
|
||||
esp32c3_mpi_free(&K);
|
||||
esp32c3_mpi_free(&L);
|
||||
|
||||
|
|
@ -990,7 +988,6 @@ static int esp32c3_rsa_validate_params(const struct esp32c3_mpi_s *N,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
esp32c3_mpi_free(&K);
|
||||
esp32c3_mpi_free(&L);
|
||||
|
||||
|
|
@ -1172,7 +1169,6 @@ int esp32c3_rsa_import_raw(struct esp32c3_rsa_context_s *ctx,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
if (ret != 0)
|
||||
{
|
||||
return (ESP32C3_ERR_RSA_BAD_INPUT_DATA + ret);
|
||||
|
|
@ -1375,7 +1371,6 @@ int esp32c3_rsa_export_raw(const struct esp32c3_rsa_context_s *ctx,
|
|||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ static ssize_t esp32c3_read(struct mtd_dev_s *dev, off_t offset,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = spi_flash_read(offset, buffer, nbytes);
|
||||
|
|
@ -260,8 +260,6 @@ static ssize_t esp32c3_read(struct mtd_dev_s *dev, off_t offset,
|
|||
finfo("%s()=%d\n", __func__, ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -449,7 +447,7 @@ static ssize_t esp32c3_bread_decrypt(struct mtd_dev_s *dev,
|
|||
static ssize_t esp32c3_write(struct mtd_dev_s *dev, off_t offset,
|
||||
size_t nbytes, const uint8_t *buffer)
|
||||
{
|
||||
int ret;
|
||||
ssize_t ret;
|
||||
struct esp32c3_mtd_dev_s *priv = (struct esp32c3_mtd_dev_s *)dev;
|
||||
|
||||
ASSERT(buffer);
|
||||
|
|
@ -470,7 +468,7 @@ static ssize_t esp32c3_write(struct mtd_dev_s *dev, off_t offset,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = spi_flash_write(offset, buffer, nbytes);
|
||||
|
|
@ -486,9 +484,7 @@ static ssize_t esp32c3_write(struct mtd_dev_s *dev, off_t offset,
|
|||
finfo("%s()=%d\n", __func__, ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return (ssize_t)ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -582,7 +578,7 @@ static ssize_t esp32c3_bwrite_encrypt(struct mtd_dev_s *dev,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = spi_flash_write_encrypted(addr, buffer, size);
|
||||
|
|
@ -598,8 +594,6 @@ static ssize_t esp32c3_bwrite_encrypt(struct mtd_dev_s *dev,
|
|||
finfo("%s()=%d\n", __func__, ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -975,7 +975,7 @@ struct esp32c3_tim_dev_s *esp32c3_tim_init(int timer)
|
|||
tim = NULL;
|
||||
}
|
||||
|
||||
errout:
|
||||
errout:
|
||||
return (struct esp32c3_tim_dev_s *)tim;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -303,7 +303,6 @@ static int32_t esp32c3_wdt_config_stage(struct esp32c3_wdt_dev_s *dev,
|
|||
enum esp32c3_wdt_stage_e stage,
|
||||
enum esp32c3_wdt_stage_action_e cfg)
|
||||
{
|
||||
int32_t ret = OK;
|
||||
uint32_t mask;
|
||||
DEBUGASSERT(dev);
|
||||
|
||||
|
|
@ -380,13 +379,11 @@ static int32_t esp32c3_wdt_config_stage(struct esp32c3_wdt_dev_s *dev,
|
|||
default:
|
||||
{
|
||||
wderr("ERROR: unsupported stage %d\n", stage);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -608,12 +605,10 @@ static int32_t esp32c3_wdt_settimeout(struct esp32c3_wdt_dev_s *dev,
|
|||
{
|
||||
wderr("ERROR: unsupported stage %d\n", stage);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
}
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -948,7 +943,7 @@ struct esp32c3_wdt_dev_s *esp32c3_wdt_init(enum esp32c3_wdt_inst_e wdt_id)
|
|||
default:
|
||||
{
|
||||
wderr("ERROR: unsupported WDT %d\n", wdt_id);
|
||||
goto errout;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -959,15 +954,14 @@ struct esp32c3_wdt_dev_s *esp32c3_wdt_init(enum esp32c3_wdt_inst_e wdt_id)
|
|||
if (wdt->inuse == true)
|
||||
{
|
||||
wderr("ERROR: WDT %d is already in use\n", wdt_id);
|
||||
wdt = NULL;
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
wdt->inuse = true;
|
||||
}
|
||||
|
||||
errout:
|
||||
return (struct esp32c3_wdt_dev_s *)wdt;
|
||||
return (struct esp32c3_wdt_dev_s *)wdt;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -190,15 +190,14 @@ static int esp32c3_wdt_start(struct watchdog_lowerhalf_s *lower)
|
|||
{
|
||||
/* Return EBUSY to indicate that the timer was already running */
|
||||
|
||||
ret = -EBUSY;
|
||||
goto errout;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/* If WDT was not started yet */
|
||||
|
||||
else
|
||||
{
|
||||
priv->started = true;
|
||||
priv->started = true;
|
||||
|
||||
/* Unlock WDT */
|
||||
|
||||
|
|
@ -253,8 +252,8 @@ static int esp32c3_wdt_start(struct watchdog_lowerhalf_s *lower)
|
|||
|
||||
ESP32C3_WDT_LOCK(priv->wdt);
|
||||
}
|
||||
errout:
|
||||
return ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -654,7 +653,6 @@ static int esp32c3_wdt_handler(int irq, void *context, void *arg)
|
|||
int esp32c3_wdt_initialize(const char *devpath, enum esp32c3_wdt_inst_e wdt)
|
||||
{
|
||||
struct esp32c3_wdt_lowerhalf_s *lower = NULL;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(devpath);
|
||||
|
||||
|
|
@ -689,8 +687,7 @@ int esp32c3_wdt_initialize(const char *devpath, enum esp32c3_wdt_inst_e wdt)
|
|||
|
||||
default:
|
||||
{
|
||||
ret = -ENODEV;
|
||||
goto errout;
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -702,8 +699,7 @@ int esp32c3_wdt_initialize(const char *devpath, enum esp32c3_wdt_inst_e wdt)
|
|||
|
||||
if (lower->wdt == NULL)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return = -EINVAL;
|
||||
}
|
||||
|
||||
lower->started = esp32c3_wdt_is_running(lower->wdt);
|
||||
|
|
@ -738,10 +734,8 @@ int esp32c3_wdt_initialize(const char *devpath, enum esp32c3_wdt_inst_e wdt)
|
|||
* indicate the failure (implying the non-unique devpath).
|
||||
*/
|
||||
|
||||
ret = -EEXIST;
|
||||
goto errout;
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,6 @@ void __k210_start(uint32_t mhartid)
|
|||
nx_start();
|
||||
|
||||
cpu1:
|
||||
|
||||
showprogress('a');
|
||||
|
||||
#if defined(CONFIG_SMP) && (CONFIG_SMP_NCPUS == 2)
|
||||
|
|
|
|||
|
|
@ -2791,7 +2791,6 @@ static sdio_eventset_t mpfs_eventwait(struct sdio_dev_s *dev)
|
|||
/* Disable event-related interrupts */
|
||||
|
||||
errout_with_waitints:
|
||||
|
||||
mpfs_configwaitints(priv, 0, 0, 0);
|
||||
|
||||
leave_critical_section(flags);
|
||||
|
|
|
|||
|
|
@ -1451,7 +1451,6 @@ int mpfs_ihc_init(void)
|
|||
return OK;
|
||||
|
||||
init_error:
|
||||
|
||||
up_disable_irq(g_plic_irq);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ void qemu_rv_start(int mhartid)
|
|||
nx_start();
|
||||
|
||||
cpux:
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
riscv_cpu_boot(mhartid);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ int really_write(int fd, uint8_t *buffer, size_t total)
|
|||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
||||
/* On error: stop listening to the socket */
|
||||
|
|
|
|||
|
|
@ -1541,7 +1541,7 @@ static int esp32_erase(struct mtd_dev_s *dev, off_t startblock,
|
|||
static ssize_t esp32_read(struct mtd_dev_s *dev, off_t offset,
|
||||
size_t nbytes, uint8_t *buffer)
|
||||
{
|
||||
int ret;
|
||||
ssize_t ret;
|
||||
struct esp32_spiflash_s *priv = MTD2PRIV(dev);
|
||||
|
||||
#ifdef CONFIG_ESP32_SPIFLASH_DEBUG
|
||||
|
|
@ -1553,7 +1553,7 @@ static ssize_t esp32_read(struct mtd_dev_s *dev, off_t offset,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp32_set_read_opt(priv);
|
||||
|
|
@ -1570,9 +1570,7 @@ static ssize_t esp32_read(struct mtd_dev_s *dev, off_t offset,
|
|||
finfo("esp32_read()=%d\n", ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return (ssize_t)ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -1641,7 +1639,7 @@ static ssize_t esp32_read_decrypt(struct mtd_dev_s *dev,
|
|||
size_t nbytes,
|
||||
uint8_t *buffer)
|
||||
{
|
||||
int ret;
|
||||
ssize_t ret;
|
||||
uint8_t *tmpbuff = buffer;
|
||||
struct esp32_spiflash_s *priv = MTD2PRIV(dev);
|
||||
|
||||
|
|
@ -1655,7 +1653,7 @@ static ssize_t esp32_read_decrypt(struct mtd_dev_s *dev,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = esp32_readdata_encrypted(priv, offset, tmpbuff, nbytes);
|
||||
|
|
@ -1671,9 +1669,7 @@ static ssize_t esp32_read_decrypt(struct mtd_dev_s *dev,
|
|||
finfo("esp32_read_decrypt()=%d\n", ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return (ssize_t)ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -1741,7 +1737,7 @@ static ssize_t esp32_bread_decrypt(struct mtd_dev_s *dev,
|
|||
static ssize_t esp32_write(struct mtd_dev_s *dev, off_t offset,
|
||||
size_t nbytes, const uint8_t *buffer)
|
||||
{
|
||||
int ret;
|
||||
ssize_t ret;
|
||||
struct esp32_spiflash_s *priv = MTD2PRIV(dev);
|
||||
|
||||
ASSERT(buffer);
|
||||
|
|
@ -1760,7 +1756,7 @@ static ssize_t esp32_write(struct mtd_dev_s *dev, off_t offset,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = esp32_writedata(priv, offset, buffer, nbytes);
|
||||
|
|
@ -1776,9 +1772,7 @@ static ssize_t esp32_write(struct mtd_dev_s *dev, off_t offset,
|
|||
finfo("esp32_write()=%d\n", ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return (ssize_t)ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -1861,7 +1855,7 @@ static ssize_t esp32_bwrite_encrypt(struct mtd_dev_s *dev,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = esp32_writedata_encrypted(priv, addr, buffer, size);
|
||||
|
|
@ -1876,9 +1870,6 @@ static ssize_t esp32_bwrite_encrypt(struct mtd_dev_s *dev,
|
|||
#ifdef CONFIG_ESP32_SPIFLASH_DEBUG
|
||||
finfo("esp32_bwrite_encrypt()=%d\n", ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -767,7 +767,7 @@ struct esp32_tim_dev_s *esp32_tim_init(int timer)
|
|||
default:
|
||||
{
|
||||
tmrerr("ERROR: unsupported TIMER %d\n", timer);
|
||||
goto errout;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -780,10 +780,9 @@ struct esp32_tim_dev_s *esp32_tim_init(int timer)
|
|||
else
|
||||
{
|
||||
tmrerr("ERROR: TIMER %d is already in use\n", timer);
|
||||
tim = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
errout:
|
||||
return (struct esp32_tim_dev_s *)tim;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -275,7 +275,6 @@ static int esp32_wdt_start(struct esp32_wdt_dev_s *dev)
|
|||
static int esp32_wdt_set_stg_conf(struct esp32_wdt_dev_s *dev,
|
||||
uint8_t stage, uint8_t conf)
|
||||
{
|
||||
int ret = OK;
|
||||
uint32_t mask;
|
||||
DEBUGASSERT(dev);
|
||||
|
||||
|
|
@ -376,13 +375,11 @@ static int esp32_wdt_set_stg_conf(struct esp32_wdt_dev_s *dev,
|
|||
default:
|
||||
{
|
||||
tmrerr("ERROR: unsupported stage %d\n", stage);
|
||||
ret = EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -571,7 +568,6 @@ static uint16_t esp32_rtc_clk(struct esp32_wdt_dev_s *dev)
|
|||
static int esp32_wdt_settimeout(struct esp32_wdt_dev_s *dev,
|
||||
uint32_t value, uint8_t stage)
|
||||
{
|
||||
int ret = OK;
|
||||
DEBUGASSERT(dev);
|
||||
|
||||
switch (stage)
|
||||
|
|
@ -655,13 +651,11 @@ static int esp32_wdt_settimeout(struct esp32_wdt_dev_s *dev,
|
|||
default:
|
||||
{
|
||||
tmrerr("ERROR: unsupported stage %d\n", stage);
|
||||
ret = EINVAL;
|
||||
goto errout;
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -951,7 +945,7 @@ struct esp32_wdt_dev_s *esp32_wdt_init(uint8_t wdt_id)
|
|||
default:
|
||||
{
|
||||
tmrerr("ERROR: unsupported WDT %d\n", wdt_id);
|
||||
goto errout;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -962,15 +956,14 @@ struct esp32_wdt_dev_s *esp32_wdt_init(uint8_t wdt_id)
|
|||
if (wdt->inuse == true)
|
||||
{
|
||||
tmrerr("ERROR: WDT %d is already in use\n", wdt_id);
|
||||
wdt = NULL;
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
wdt->inuse = true;
|
||||
}
|
||||
|
||||
errout:
|
||||
return (struct esp32_wdt_dev_s *)wdt;
|
||||
return (struct esp32_wdt_dev_s *)wdt;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -171,7 +171,6 @@ static int esp32_wdt_start(struct watchdog_lowerhalf_s *lower)
|
|||
{
|
||||
struct esp32_wdt_lowerhalf_s *priv =
|
||||
(struct esp32_wdt_lowerhalf_s *)lower;
|
||||
int ret = OK;
|
||||
irqstate_t flags;
|
||||
|
||||
wdinfo("Entry: started\n");
|
||||
|
|
@ -181,8 +180,7 @@ static int esp32_wdt_start(struct watchdog_lowerhalf_s *lower)
|
|||
{
|
||||
/* Return EBUSY to indicate that the timer was already running */
|
||||
|
||||
ret = -EBUSY;
|
||||
goto errout;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/* If WDT was not started yet */
|
||||
|
|
@ -237,8 +235,8 @@ static int esp32_wdt_start(struct watchdog_lowerhalf_s *lower)
|
|||
|
||||
ESP32_WDT_LOCK(priv->wdt);
|
||||
}
|
||||
errout:
|
||||
return ret;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -288,7 +288,6 @@ static int32_t wdt_config_stage(struct esp32s2_wdt_dev_s *dev,
|
|||
enum esp32s2_wdt_stage_e stage,
|
||||
enum esp32s2_wdt_stage_action_e cfg)
|
||||
{
|
||||
int32_t ret = OK;
|
||||
uint32_t mask;
|
||||
|
||||
DEBUGASSERT(dev != NULL);
|
||||
|
|
@ -362,13 +361,11 @@ static int32_t wdt_config_stage(struct esp32s2_wdt_dev_s *dev,
|
|||
default:
|
||||
{
|
||||
wderr("ERROR: unsupported stage %d\n", stage);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -499,8 +496,6 @@ static void wdt_pre(struct esp32s2_wdt_dev_s *dev, uint16_t pre)
|
|||
static int32_t wdt_settimeout(struct esp32s2_wdt_dev_s *dev, uint32_t value,
|
||||
enum esp32s2_wdt_stage_e stage)
|
||||
{
|
||||
int32_t ret = OK;
|
||||
|
||||
DEBUGASSERT(dev != NULL);
|
||||
|
||||
switch (stage)
|
||||
|
|
@ -568,13 +563,11 @@ static int32_t wdt_settimeout(struct esp32s2_wdt_dev_s *dev, uint32_t value,
|
|||
default:
|
||||
{
|
||||
wderr("ERROR: unsupported stage %d\n", stage);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -650,7 +643,6 @@ static int32_t wdt_setisr(struct esp32s2_wdt_dev_s *dev, xcpt_t handler,
|
|||
irq_detach(wdt->irq);
|
||||
}
|
||||
|
||||
ret = OK;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
|
@ -671,7 +663,6 @@ static int32_t wdt_setisr(struct esp32s2_wdt_dev_s *dev, xcpt_t handler,
|
|||
/* Associate an IRQ Number (from the WDT) to an ISR */
|
||||
|
||||
ret = irq_attach(wdt->irq, handler, arg);
|
||||
|
||||
if (ret != OK)
|
||||
{
|
||||
esp32s2_teardown_irq(wdt->periph, wdt->cpuint);
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ static ssize_t esp32s3_read(struct mtd_dev_s *dev, off_t offset,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = spi_flash_read(offset, buffer, nbytes);
|
||||
|
|
@ -264,8 +264,6 @@ static ssize_t esp32s3_read(struct mtd_dev_s *dev, off_t offset,
|
|||
finfo("%s()=%d\n", __func__, ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -429,7 +427,6 @@ static ssize_t esp32s3_bread_decrypt(struct mtd_dev_s *dev,
|
|||
#ifdef CONFIG_ESP32S3_STORAGE_MTD_DEBUG
|
||||
finfo("%s()=%d\n", __func__, ret);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -453,7 +450,7 @@ static ssize_t esp32s3_bread_decrypt(struct mtd_dev_s *dev,
|
|||
static ssize_t esp32s3_write(struct mtd_dev_s *dev, off_t offset,
|
||||
size_t nbytes, const uint8_t *buffer)
|
||||
{
|
||||
int ret;
|
||||
ssize_t ret;
|
||||
struct esp32s3_mtd_dev_s *priv = (struct esp32s3_mtd_dev_s *)dev;
|
||||
|
||||
ASSERT(buffer);
|
||||
|
|
@ -474,7 +471,7 @@ static ssize_t esp32s3_write(struct mtd_dev_s *dev, off_t offset,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = spi_flash_write(offset, buffer, nbytes);
|
||||
|
|
@ -489,10 +486,7 @@ static ssize_t esp32s3_write(struct mtd_dev_s *dev, off_t offset,
|
|||
#ifdef CONFIG_ESP32S3_STORAGE_MTD_DEBUG
|
||||
finfo("%s()=%d\n", __func__, ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return (ssize_t)ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -532,7 +526,7 @@ static ssize_t esp32s3_bwrite_encrypt(struct mtd_dev_s *dev,
|
|||
ret = nxsem_wait(&g_exclsem);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto error_with_buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = spi_flash_write_encrypted(addr, buffer, size);
|
||||
|
|
@ -547,9 +541,6 @@ static ssize_t esp32s3_bwrite_encrypt(struct mtd_dev_s *dev,
|
|||
#ifdef CONFIG_ESP32S3_STORAGE_MTD_DEBUG
|
||||
finfo("%s()=%d\n", __func__, ret);
|
||||
#endif
|
||||
|
||||
error_with_buffer:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -290,7 +290,6 @@ static int32_t wdt_config_stage(struct esp32s3_wdt_dev_s *dev,
|
|||
enum esp32s3_wdt_stage_e stage,
|
||||
enum esp32s3_wdt_stage_action_e cfg)
|
||||
{
|
||||
int32_t ret = OK;
|
||||
uint32_t mask;
|
||||
|
||||
DEBUGASSERT(dev != NULL);
|
||||
|
|
@ -364,13 +363,11 @@ static int32_t wdt_config_stage(struct esp32s3_wdt_dev_s *dev,
|
|||
default:
|
||||
{
|
||||
wderr("ERROR: unsupported stage %d\n", stage);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -501,8 +498,6 @@ static void wdt_pre(struct esp32s3_wdt_dev_s *dev, uint16_t pre)
|
|||
static int32_t wdt_settimeout(struct esp32s3_wdt_dev_s *dev, uint32_t value,
|
||||
enum esp32s3_wdt_stage_e stage)
|
||||
{
|
||||
int32_t ret = OK;
|
||||
|
||||
DEBUGASSERT(dev != NULL);
|
||||
|
||||
switch (stage)
|
||||
|
|
@ -570,13 +565,11 @@ static int32_t wdt_settimeout(struct esp32s3_wdt_dev_s *dev, uint32_t value,
|
|||
default:
|
||||
{
|
||||
wderr("ERROR: unsupported stage %d\n", stage);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -652,7 +645,6 @@ static int32_t wdt_setisr(struct esp32s3_wdt_dev_s *dev, xcpt_t handler,
|
|||
irq_detach(wdt->irq);
|
||||
}
|
||||
|
||||
ret = OK;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
|
@ -675,7 +667,6 @@ static int32_t wdt_setisr(struct esp32s3_wdt_dev_s *dev, xcpt_t handler,
|
|||
/* Associate an IRQ Number (from the WDT) to an ISR */
|
||||
|
||||
ret = irq_attach(wdt->irq, handler, arg);
|
||||
|
||||
if (ret != OK)
|
||||
{
|
||||
esp32s3_teardown_irq(wdt->cpu, wdt->periph, wdt->cpuint);
|
||||
|
|
|
|||
|
|
@ -182,7 +182,6 @@ static int wdt_lh_start(struct watchdog_lowerhalf_s *lower)
|
|||
{
|
||||
struct esp32s3_wdt_lowerhalf_s *priv =
|
||||
(struct esp32s3_wdt_lowerhalf_s *)lower;
|
||||
int ret = OK;
|
||||
|
||||
wdinfo("Entry: wdt_lh_start\n");
|
||||
|
||||
|
|
@ -192,8 +191,7 @@ static int wdt_lh_start(struct watchdog_lowerhalf_s *lower)
|
|||
{
|
||||
/* Return EBUSY to indicate that the timer was already running */
|
||||
|
||||
ret = -EBUSY;
|
||||
goto errout;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/* If WDT was not started yet */
|
||||
|
|
@ -253,8 +251,7 @@ static int wdt_lh_start(struct watchdog_lowerhalf_s *lower)
|
|||
ESP32S3_WDT_LOCK(priv->wdt);
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -371,7 +371,6 @@ int stm32_cs43l22_initialize(int minor)
|
|||
errout_with_pcm:
|
||||
errout_with_cs43l22:
|
||||
errout_with_irq:
|
||||
|
||||
#if 0
|
||||
irq_detach(IRQ_INT_CS43L22);
|
||||
errout_with_i2s:
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ int stm32l4_bringup(void)
|
|||
mtd_part, partref);
|
||||
#endif
|
||||
|
||||
process_next_part:
|
||||
process_next_part:
|
||||
|
||||
/* Update the pointer to point to the next size in the list */
|
||||
|
||||
|
|
|
|||
|
|
@ -147,9 +147,7 @@ static struct ap_buffer_s *cxd56_src_get_apb(void)
|
|||
src_apb->flags = 0;
|
||||
|
||||
errorout_with_lock:
|
||||
|
||||
spin_unlock_irqrestore(NULL, flags);
|
||||
|
||||
return src_apb;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1232,7 +1232,6 @@ static void tca64_irqworker(void *arg)
|
|||
}
|
||||
|
||||
errout_with_restart:
|
||||
|
||||
#ifdef CONFIG_TCA64XX_INT_POLL
|
||||
/* Check for pending interrupts */
|
||||
|
||||
|
|
|
|||
|
|
@ -1323,7 +1323,6 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size)
|
|||
*/
|
||||
|
||||
errexit:
|
||||
|
||||
#ifndef CONFIG_MTD_SMART_MINIMIZE_RAM
|
||||
if (dev->smap)
|
||||
{
|
||||
|
|
@ -4975,8 +4974,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev,
|
|||
{
|
||||
ferr("ERROR: Logical sector %d too large\n", req->logsector);
|
||||
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_MTD_SMART_MINIMIZE_RAM
|
||||
|
|
@ -4987,8 +4985,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev,
|
|||
if (physsector == 0xffff)
|
||||
{
|
||||
ferr("ERROR: Logical sector %d not allocated\n", req->logsector);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MTD_SMART_ENABLE_CRC
|
||||
|
|
@ -5004,8 +5001,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev,
|
|||
/* TODO: Mark the block bad */
|
||||
|
||||
ferr("ERROR: Error reading phys sector %d\n", physsector);
|
||||
ret = -EIO;
|
||||
goto errout;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
#if SMART_STATUS_VERSION == 1
|
||||
|
|
@ -5031,8 +5027,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev,
|
|||
|
||||
ferr("ERROR: Error validating sector %d CRC during read\n",
|
||||
physsector);
|
||||
ret = -EIO;
|
||||
goto errout;
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5052,8 +5047,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev,
|
|||
if (ret != sizeof(struct smart_sect_header_s))
|
||||
{
|
||||
ferr("ERROR: Error reading sector %d header\n", physsector);
|
||||
ret = -EIO;
|
||||
goto errout;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Do a sanity check on the header data */
|
||||
|
|
@ -5066,8 +5060,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev,
|
|||
|
||||
ferr("ERROR: Error in logical sector %d header, phys=%d\n",
|
||||
req->logsector, physsector);
|
||||
ret = -EIO;
|
||||
goto errout;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Read the sector data into the buffer */
|
||||
|
|
@ -5081,14 +5074,10 @@ static int smart_readsector(FAR struct smart_struct_s *dev,
|
|||
if (ret != req->count)
|
||||
{
|
||||
ferr("ERROR: Error reading phys sector %d\n", physsector);
|
||||
ret = -EIO;
|
||||
goto errout;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
errout:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,8 @@ static inline void fakesensor_read_gps(FAR struct fakesensor_s *sensor)
|
|||
float altitude;
|
||||
char raw[150];
|
||||
memset(&gps, 0, sizeof(struct sensor_gps));
|
||||
read:
|
||||
|
||||
read:
|
||||
fakesensor_read_csv_line(
|
||||
&sensor->data, raw, sizeof(raw), sensor->raw_start);
|
||||
FAR char *pos = strstr(raw, "GGA");
|
||||
|
|
|
|||
|
|
@ -420,7 +420,6 @@ static ssize_t lps25h_read(FAR struct file *filep, FAR char *buffer,
|
|||
}
|
||||
|
||||
out:
|
||||
|
||||
nxsem_post(&dev->devsem);
|
||||
return length;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -849,7 +849,6 @@ static int max44009_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||
}
|
||||
|
||||
out:
|
||||
|
||||
nxsem_post(&priv->dev_sem);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ static void log_rotate(FAR const char *log_file)
|
|||
rename(log_file, rotate_to);
|
||||
|
||||
end:
|
||||
|
||||
kmm_free(rotate_to);
|
||||
kmm_free(rotate_from);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -891,7 +891,6 @@ static int usbhost_xboxcontroller_poll(int argc, char *argv[])
|
|||
}
|
||||
|
||||
exitloop:
|
||||
|
||||
/* We get here when the driver is removed, when too many errors have
|
||||
* been encountered, or when the thread is canceled.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ static int load_bcm4343x_firmware(FAR const struct btuart_lowerhalf_s *lower)
|
|||
ret = -ECOMM;
|
||||
}
|
||||
|
||||
load_bcm4343x_firmware_finished:
|
||||
load_bcm4343x_firmware_finished:
|
||||
lower->rxenable(lower, false);
|
||||
lower->rxattach(lower, NULL, NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -671,7 +671,6 @@ static bool _copy_data_from_pkt(FAR struct gs2200m_dev_s *dev,
|
|||
}
|
||||
|
||||
errout:
|
||||
|
||||
if (!msg->is_tcp)
|
||||
{
|
||||
/* Copy the source address and port */
|
||||
|
|
@ -1014,7 +1013,6 @@ enum spi_status_e gs2200m_hal_read(FAR struct gs2200m_dev_s *dev,
|
|||
FAR uint8_t *data,
|
||||
FAR uint16_t *len)
|
||||
{
|
||||
enum spi_status_e r = SPI_OK;
|
||||
uint8_t hdr[8];
|
||||
int i;
|
||||
|
||||
|
|
@ -1035,8 +1033,7 @@ enum spi_status_e gs2200m_hal_read(FAR struct gs2200m_dev_s *dev,
|
|||
if (HAL_TIMEOUT == i)
|
||||
{
|
||||
wlerr("***** error: timeout!\n");
|
||||
r = SPI_TIMEOUT;
|
||||
goto errout;
|
||||
return SPI_TIMEOUT;
|
||||
}
|
||||
|
||||
/* Send READ_REQUEST then receive READ_RESPONSE
|
||||
|
|
@ -1058,9 +1055,7 @@ enum spi_status_e gs2200m_hal_read(FAR struct gs2200m_dev_s *dev,
|
|||
/* Read the actual data */
|
||||
|
||||
_read_data(dev, data, *len);
|
||||
|
||||
errout:
|
||||
return r;
|
||||
return SPI_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -1509,7 +1504,6 @@ static enum pkt_type_e gs2200m_send_cmd(FAR struct gs2200m_dev_s *dev,
|
|||
wlinfo("+++ cmd=%s", cmd);
|
||||
|
||||
retry:
|
||||
|
||||
s = gs2200m_hal_write(dev, cmd, strlen(cmd));
|
||||
r = _spi_err_to_pkt_type(s);
|
||||
|
||||
|
|
@ -1519,7 +1513,6 @@ retry:
|
|||
}
|
||||
|
||||
retry_recv:
|
||||
|
||||
r = gs2200m_recv_pkt(dev, pkt_dat);
|
||||
|
||||
if ((TYPE_BULK_DATA_TCP == r || TYPE_BULK_DATA_UDP == r) && pkt_dat)
|
||||
|
|
@ -1558,7 +1551,6 @@ retry_recv:
|
|||
}
|
||||
|
||||
errout:
|
||||
|
||||
if (bulk)
|
||||
{
|
||||
wlwarn("*** Normal response r=%d\n", r);
|
||||
|
|
@ -1567,7 +1559,6 @@ errout:
|
|||
/* Enable gs2200m irq again */
|
||||
|
||||
dev->lower->enable();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
@ -2304,7 +2295,6 @@ static int gs2200m_ioctl_bind(FAR struct gs2200m_dev_s *dev,
|
|||
}
|
||||
|
||||
retry:
|
||||
|
||||
snprintf(port_str, sizeof(port_str), "%d", port);
|
||||
|
||||
/* Start TCP/UDP server and retrieve cid */
|
||||
|
|
@ -2329,12 +2319,10 @@ retry:
|
|||
_check_pkt_q_empty(dev, cid);
|
||||
|
||||
errout:
|
||||
|
||||
msg->type = type;
|
||||
msg->cid = cid;
|
||||
|
||||
wlinfo("+++ end: type=%d (cid=%c)\n", type, cid);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2434,7 +2422,6 @@ static int gs2200m_ioctl_send(FAR struct gs2200m_dev_s *dev,
|
|||
msg->type = type;
|
||||
|
||||
errout:
|
||||
|
||||
if (type != TYPE_OK && type != TYPE_DISCONNECT)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
|
|
@ -2446,7 +2433,6 @@ errout:
|
|||
|
||||
wlinfo("+++ end: cid=%c len=%d type=%d\n",
|
||||
msg->cid, msg->len, type);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2502,14 +2488,12 @@ static int gs2200m_ioctl_recv(FAR struct gs2200m_dev_s *dev,
|
|||
_control_pkt_q(dev);
|
||||
|
||||
errout:
|
||||
|
||||
#ifdef USE_LED
|
||||
gs2200m_set_gpio(dev, LED_GPIO, 0);
|
||||
#endif
|
||||
|
||||
wlinfo("+++ end: cid=%c len=%d type=%d ret=%d\n",
|
||||
msg->cid, msg->len, msg->type, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2553,7 +2537,6 @@ errout:
|
|||
_control_pkt_q(dev);
|
||||
|
||||
wlinfo("++ end: cid=%c type=%d\n", msg->cid, type);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2627,7 +2610,6 @@ static int gs2200m_ioctl_accept(FAR struct gs2200m_dev_s *dev,
|
|||
|
||||
errout:
|
||||
wlinfo("+++ end: type=%d (msg->cid=%c)\n", msg->type, msg->cid);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2971,16 +2953,13 @@ static int gs2200m_ioctl_name(FAR struct gs2200m_dev_s *dev,
|
|||
FAR struct gs2200m_name_msg *msg)
|
||||
{
|
||||
enum pkt_type_e r;
|
||||
int ret = 0;
|
||||
|
||||
/* Obtain connection status */
|
||||
|
||||
r = gs2200m_get_cstatus(dev, msg);
|
||||
|
||||
if (r != TYPE_OK)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (msg->local)
|
||||
|
|
@ -2993,9 +2972,7 @@ static int gs2200m_ioctl_name(FAR struct gs2200m_dev_s *dev,
|
|||
);
|
||||
}
|
||||
|
||||
errout:
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -3233,7 +3210,6 @@ static void gs2200m_irq_worker(FAR void *arg)
|
|||
while (ret < 0);
|
||||
|
||||
repeat:
|
||||
|
||||
n = dev->lower->dready(&ec);
|
||||
wlinfo("== start (dready=%d, ec=%d)\n", n, ec);
|
||||
|
||||
|
|
@ -3354,7 +3330,6 @@ repeat:
|
|||
over = _control_pkt_q(dev);
|
||||
|
||||
errout:
|
||||
|
||||
if (ignored)
|
||||
{
|
||||
_release_pkt_dat(dev, pkt_dat);
|
||||
|
|
@ -3375,7 +3350,6 @@ errout:
|
|||
/* NOTE: Enable gs2200m irq which was disabled in gs2200m_irq() */
|
||||
|
||||
dev->lower->enable();
|
||||
|
||||
gs2200m_unlock(dev);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -751,7 +751,6 @@ process_next_bss:
|
|||
}
|
||||
|
||||
wl_escan_result_processed:
|
||||
|
||||
if (status == WLC_E_STATUS_PARTIAL)
|
||||
{
|
||||
/* More frames to come */
|
||||
|
|
|
|||
|
|
@ -893,7 +893,6 @@ static int bcmf_bus_gspi_initialize(FAR struct bcmf_dev_s *priv,
|
|||
return OK;
|
||||
|
||||
exit_free_bus:
|
||||
|
||||
wlinfo("failed.\n");
|
||||
|
||||
kmm_free(gbus);
|
||||
|
|
|
|||
|
|
@ -730,7 +730,6 @@ errout_in_wl_active:
|
|||
bcmf_wl_active(priv, false);
|
||||
|
||||
errout_in_critical_section:
|
||||
|
||||
leave_critical_section(flags);
|
||||
|
||||
wlinfo("bcmf_ifup done: %d\n", ret);
|
||||
|
|
|
|||
|
|
@ -365,7 +365,6 @@ int bcmf_probe(FAR struct bcmf_sdio_dev_s *sbus)
|
|||
return OK;
|
||||
|
||||
exit_error:
|
||||
|
||||
wlerr("ERROR: failed to probe device %d\n", sbus->minor);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,6 @@ static void mrf24j40_irqwork_rx(FAR struct mrf24j40_radio_s *dev)
|
|||
dev->radiocb->rxframe(dev->radiocb, ind);
|
||||
|
||||
done:
|
||||
|
||||
/* Enable reception of next packet by flushing the fifo.
|
||||
* This is an MRF24J40 errata (no. 1).
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -773,7 +773,6 @@ static int sx127x_open(FAR struct file *filep)
|
|||
|
||||
errout:
|
||||
nxsem_post(&dev->dev_sem);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -816,7 +815,6 @@ static int sx127x_close(FAR struct file *filep)
|
|||
dev->nopens--;
|
||||
|
||||
nxsem_post(&dev->dev_sem);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
@ -944,7 +942,6 @@ errout:
|
|||
*/
|
||||
|
||||
sx127x_opmode_set(dev, dev->idle);
|
||||
|
||||
nxsem_post(&dev->dev_sem);
|
||||
|
||||
return ret;
|
||||
|
|
@ -1185,7 +1182,7 @@ static int sx127x_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
|||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
dev = (FAR struct sx127x_dev_s *)inode->i_private;
|
||||
dev = (FAR struct sx127x_dev_s *)inode->i_private;
|
||||
|
||||
/* Exclusive access */
|
||||
|
||||
|
|
@ -1580,7 +1577,7 @@ static size_t sx127x_fskook_rxhandle(FAR struct sx127x_dev_s *dev)
|
|||
wlerr("Unsupported data length! %d > %d\n",
|
||||
datalen, SX127X_READ_DATA_MAX);
|
||||
sx127x_unlock(dev->spi);
|
||||
goto errout;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Read payload and store */
|
||||
|
|
@ -1611,8 +1608,6 @@ static size_t sx127x_fskook_rxhandle(FAR struct sx127x_dev_s *dev)
|
|||
|
||||
sx127x_rxfifo_put(dev, (uint8_t *)&rxdata, len);
|
||||
|
||||
errout:
|
||||
|
||||
/* Return total length */
|
||||
|
||||
return len;
|
||||
|
|
@ -1652,7 +1647,7 @@ static size_t sx127x_lora_rxhandle(FAR struct sx127x_dev_s *dev)
|
|||
wlerr("Unsupported data length! %d > %d\n",
|
||||
datalen, SX127X_READ_DATA_MAX);
|
||||
sx127x_unlock(dev->spi);
|
||||
goto errout;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Get start address of last packet received */
|
||||
|
|
@ -1691,8 +1686,6 @@ static size_t sx127x_lora_rxhandle(FAR struct sx127x_dev_s *dev)
|
|||
|
||||
sx127x_rxfifo_put(dev, (uint8_t *)&rxdata, len);
|
||||
|
||||
errout:
|
||||
|
||||
/* Return total length */
|
||||
|
||||
return len;
|
||||
|
|
@ -1815,7 +1808,6 @@ static int sx127x_txfifo_write(FAR struct sx127x_dev_s *dev,
|
|||
/* Write buffer to FIFO */
|
||||
|
||||
sx127x_writereg(dev, SX127X_CMN_FIFO, data, datalen);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
@ -1841,8 +1833,7 @@ static int sx127x_fskook_send(FAR struct sx127x_dev_s *dev,
|
|||
if (datalen > SX127X_FOM_PAYLOADLEN_MAX)
|
||||
{
|
||||
wlerr("Not supported data len!\n");
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
|
@ -1854,8 +1845,7 @@ static int sx127x_fskook_send(FAR struct sx127x_dev_s *dev,
|
|||
if (datalen > 63)
|
||||
{
|
||||
wlerr("Not supported data len!\n");
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1883,8 +1873,6 @@ static int sx127x_fskook_send(FAR struct sx127x_dev_s *dev,
|
|||
/* Unlock SPI */
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_LPWAN_SX127X_FSKOOK */
|
||||
|
|
@ -1910,8 +1898,7 @@ static int sx127x_lora_send(FAR struct sx127x_dev_s *dev,
|
|||
if (datalen > SX127X_LRM_PAYLOADLEN_MAX)
|
||||
{
|
||||
wlerr("Not supported data len!\n");
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Lock SPI */
|
||||
|
|
@ -1929,8 +1916,6 @@ static int sx127x_lora_send(FAR struct sx127x_dev_s *dev,
|
|||
/* Unlock SPI */
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_LPWAN_SX127X_LORA */
|
||||
|
|
@ -1950,7 +1935,7 @@ static int sx127x_opmode_init(FAR struct sx127x_dev_s *dev, uint8_t opmode)
|
|||
|
||||
if (opmode == dev->opmode)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Board-specific opmode configuration */
|
||||
|
|
@ -1959,7 +1944,7 @@ static int sx127x_opmode_init(FAR struct sx127x_dev_s *dev, uint8_t opmode)
|
|||
if (ret < 0)
|
||||
{
|
||||
wlerr("Board-specific opmode_change failed %d!\n", ret);
|
||||
goto errout;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Initialize opmode */
|
||||
|
|
@ -1968,10 +1953,9 @@ static int sx127x_opmode_init(FAR struct sx127x_dev_s *dev, uint8_t opmode)
|
|||
if (ret < 0)
|
||||
{
|
||||
wlerr("opmode_init failed %d!\n", ret);
|
||||
goto errout;
|
||||
return ret;
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1991,7 +1975,7 @@ static int sx127x_opmode_set(FAR struct sx127x_dev_s *dev, uint8_t opmode)
|
|||
|
||||
if (opmode == dev->opmode)
|
||||
{
|
||||
goto errout;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPWAN_SX127X_RXSUPPORT
|
||||
|
|
@ -2012,8 +1996,6 @@ static int sx127x_opmode_set(FAR struct sx127x_dev_s *dev, uint8_t opmode)
|
|||
/* Update local variable */
|
||||
|
||||
dev->opmode = opmode;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2113,9 +2095,8 @@ static int sx127x_fskook_opmode_init(FAR struct sx127x_dev_s *dev,
|
|||
clrbits = SX127X_CMN_DIOMAP1_DIO0_MASK;
|
||||
sx127x_modregbyte(dev, SX127X_CMN_DIOMAP1, setbits, clrbits);
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
errout:
|
||||
sx127x_unlock(dev->spi);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2136,7 +2117,6 @@ static int sx127x_fskook_opmode_set(FAR struct sx127x_dev_s *dev,
|
|||
|
||||
uint8_t setbits = 0;
|
||||
uint8_t clrbits = 0;
|
||||
int ret = OK;
|
||||
|
||||
switch (opmode)
|
||||
{
|
||||
|
|
@ -2155,8 +2135,7 @@ static int sx127x_fskook_opmode_set(FAR struct sx127x_dev_s *dev,
|
|||
default:
|
||||
{
|
||||
wlerr("ERROR: invalid FSK/OOK mode %d\n", opmode);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2169,9 +2148,7 @@ static int sx127x_fskook_opmode_set(FAR struct sx127x_dev_s *dev,
|
|||
sx127x_modregbyte(dev, SX127X_CMN_OPMODE, setbits, clrbits);
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPWAN_SX127X_FSKOOK
|
||||
|
|
@ -2190,11 +2167,9 @@ static int sx127x_fskook_rxbw_set(FAR struct sx127x_dev_s *dev,
|
|||
DEBUGASSERT(dev->modulation == SX127X_MODULATION_FSK ||
|
||||
dev->modulation == SX127X_MODULATION_OOK);
|
||||
|
||||
int ret = OK;
|
||||
|
||||
if (rx_bw == dev->fskook.rx_bw)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
switch (rx_bw)
|
||||
|
|
@ -2239,17 +2214,14 @@ static int sx127x_fskook_rxbw_set(FAR struct sx127x_dev_s *dev,
|
|||
default:
|
||||
{
|
||||
wlerr("Unsupported bandwidth %d\n", rx_bw);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update local */
|
||||
|
||||
dev->fskook.rx_bw = rx_bw;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -2266,11 +2238,9 @@ static int sx127x_fskook_afcbw_set(FAR struct sx127x_dev_s *dev,
|
|||
DEBUGASSERT(dev->modulation == SX127X_MODULATION_FSK ||
|
||||
dev->modulation == SX127X_MODULATION_OOK);
|
||||
|
||||
int ret = OK;
|
||||
|
||||
if (afc_bw == dev->fskook.afc_bw)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
switch (afc_bw)
|
||||
|
|
@ -2315,17 +2285,14 @@ static int sx127x_fskook_afcbw_set(FAR struct sx127x_dev_s *dev,
|
|||
default:
|
||||
{
|
||||
wlerr("Unsupported bandwidth %d\n", afc_bw);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update local */
|
||||
|
||||
dev->fskook.afc_bw = afc_bw;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -2382,7 +2349,6 @@ static int sx127x_fskook_seq_init(FAR struct sx127x_dev_s *dev)
|
|||
|
||||
uint8_t seq1 = 0;
|
||||
uint8_t seq2 = 0;
|
||||
int ret = OK;
|
||||
|
||||
/* Need sleep mode or standby mode */
|
||||
|
||||
|
|
@ -2408,8 +2374,7 @@ static int sx127x_fskook_seq_init(FAR struct sx127x_dev_s *dev)
|
|||
/* Unlock SPI */
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -2442,14 +2407,12 @@ static int sx127x_fskook_syncword_set(FAR struct sx127x_dev_s *dev,
|
|||
uint8_t setbits = 0;
|
||||
uint8_t clrbits = 0;
|
||||
uint8_t offset = 0;
|
||||
int ret = OK;
|
||||
int i = 0;
|
||||
|
||||
if (len > SX127X_FOM_SYNCSIZE_MAX)
|
||||
{
|
||||
wlerr("Unsupported sync word length %d!", len);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Lock SPI */
|
||||
|
|
@ -2488,9 +2451,7 @@ static int sx127x_fskook_syncword_set(FAR struct sx127x_dev_s *dev,
|
|||
/* Unlock SPI */
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -2624,19 +2585,17 @@ static int sx127x_fskook_fdev_set(FAR struct sx127x_dev_s *dev,
|
|||
uint32_t freq)
|
||||
{
|
||||
uint32_t fdev = 0;
|
||||
int ret = OK;
|
||||
|
||||
/* Only for FSK modulation */
|
||||
|
||||
if (dev->modulation != SX127X_MODULATION_FSK)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (freq == dev->fskook.fdev)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Lock SPI */
|
||||
|
|
@ -2662,9 +2621,7 @@ static int sx127x_fskook_fdev_set(FAR struct sx127x_dev_s *dev,
|
|||
/* Update local variable */
|
||||
|
||||
dev->fskook.fdev = freq;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -2678,12 +2635,11 @@ errout:
|
|||
static int sx127x_fskook_bitrate_set(FAR struct sx127x_dev_s *dev,
|
||||
uint32_t bitrate)
|
||||
{
|
||||
uint32_t br = 0;
|
||||
int ret = OK;
|
||||
uint32_t br = 0;
|
||||
|
||||
if (bitrate == dev->fskook.bitrate)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Get bitrate register value */
|
||||
|
|
@ -2715,9 +2671,7 @@ static int sx127x_fskook_bitrate_set(FAR struct sx127x_dev_s *dev,
|
|||
/* Update local variable */
|
||||
|
||||
dev->fskook.bitrate = bitrate;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -2836,7 +2790,6 @@ static int sx127x_lora_opmode_init(FAR struct sx127x_dev_s *dev,
|
|||
/* Reset FIFO pointer */
|
||||
|
||||
sx127x_writeregbyte(dev, SX127X_LRM_ADDRPTR, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2854,7 +2807,6 @@ static int sx127x_lora_opmode_init(FAR struct sx127x_dev_s *dev,
|
|||
/* Reset FIFO pointer */
|
||||
|
||||
sx127x_writeregbyte(dev, SX127X_LRM_ADDRPTR, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2863,7 +2815,6 @@ static int sx127x_lora_opmode_init(FAR struct sx127x_dev_s *dev,
|
|||
/* DIO0 is CAD DONE */
|
||||
|
||||
dio0map = SX127X_LRM_DIOMAP1_DIO0_CADDONE;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2881,9 +2832,8 @@ static int sx127x_lora_opmode_init(FAR struct sx127x_dev_s *dev,
|
|||
clrbits = SX127X_CMN_DIOMAP1_DIO0_MASK;
|
||||
sx127x_modregbyte(dev, SX127X_CMN_DIOMAP1, setbits, clrbits);
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
errout:
|
||||
sx127x_unlock(dev->spi);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2934,13 +2884,12 @@ static int sx127x_lora_opmode_set(FAR struct sx127x_dev_s *dev,
|
|||
((opmode - 1) << SX127X_CMN_OPMODE_MODE_SHIFT),
|
||||
SX127X_CMN_OPMODE_MODE_MASK);
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
/* Wait for mode ready. REVISIT: do we need this ? */
|
||||
|
||||
nxsig_usleep(250);
|
||||
|
||||
errout:
|
||||
sx127x_unlock(dev->spi);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2970,13 +2919,10 @@ static int sx127x_lora_syncword_set(FAR struct sx127x_dev_s *dev,
|
|||
{
|
||||
DEBUGASSERT(dev->modulation == SX127X_MODULATION_LORA);
|
||||
|
||||
int ret = OK;
|
||||
|
||||
if (len != 1)
|
||||
{
|
||||
wlerr("LORA support sync word with len = 1 but len = %d\n", len);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Lock SPI */
|
||||
|
|
@ -2990,9 +2936,7 @@ static int sx127x_lora_syncword_set(FAR struct sx127x_dev_s *dev,
|
|||
/* Unlock SPI */
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -3009,11 +2953,10 @@ static int sx127x_lora_bw_set(FAR struct sx127x_dev_s *dev, uint8_t bw)
|
|||
|
||||
uint8_t clrbits = 0;
|
||||
uint8_t setbits = 0;
|
||||
int ret = OK;
|
||||
|
||||
if (bw == dev->lora.bw)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
switch (bw)
|
||||
|
|
@ -3039,22 +2982,18 @@ static int sx127x_lora_bw_set(FAR struct sx127x_dev_s *dev, uint8_t bw)
|
|||
/* Unlock SPI */
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
ret = -EINVAL;
|
||||
wlerr("Unsupported bandwidth %d\n", bw);
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
dev->lora.bw = bw;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -3071,11 +3010,10 @@ static int sx127x_lora_cr_set(FAR struct sx127x_dev_s *dev, uint8_t cr)
|
|||
|
||||
uint8_t clrbits = 0;
|
||||
uint8_t setbits = 0;
|
||||
int ret = OK;
|
||||
|
||||
if (cr == dev->lora.cr)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
switch (cr)
|
||||
|
|
@ -3096,22 +3034,18 @@ static int sx127x_lora_cr_set(FAR struct sx127x_dev_s *dev, uint8_t cr)
|
|||
/* Unlock SPI */
|
||||
|
||||
sx127x_unlock(dev->spi);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
ret = -EINVAL;
|
||||
wlerr("Unsupported code rate %d\n", cr);
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
dev->lora.cr = cr;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -3130,11 +3064,10 @@ static int sx127x_lora_sf_set(FAR struct sx127x_dev_s *dev, uint8_t sf)
|
|||
uint8_t dthr = SX127X_LRM_DETECTTHR_SF7SF12;
|
||||
uint8_t setbits = 0;
|
||||
uint8_t clrbits = 0;
|
||||
int ret = OK;
|
||||
|
||||
if (dev->lora.sf == sf)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Special configuration required by SF6 (highest data rate transmission):
|
||||
|
|
@ -3148,8 +3081,7 @@ static int sx127x_lora_sf_set(FAR struct sx127x_dev_s *dev, uint8_t sf)
|
|||
if (dev->lora.implicthdr == true)
|
||||
{
|
||||
wlerr("SF6 needs implicit header ON!\n");
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dopt = SX127X_LRM_DETECTOPT_DO_SF6;
|
||||
|
|
@ -3176,9 +3108,7 @@ static int sx127x_lora_sf_set(FAR struct sx127x_dev_s *dev, uint8_t sf)
|
|||
/* Update local variable */
|
||||
|
||||
dev->lora.sf = sf;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -3196,18 +3126,16 @@ static int sx127x_lora_implicthdr_set(FAR struct sx127x_dev_s *dev,
|
|||
|
||||
uint8_t setbits = 0;
|
||||
uint8_t clrbits = 0;
|
||||
int ret = OK;
|
||||
|
||||
if (dev->lora.sf == 6 && enable == false)
|
||||
{
|
||||
wlerr("SF=6 requires implicit header ON\n");
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (enable == dev->lora.implicthdr)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Lock SPI */
|
||||
|
|
@ -3228,9 +3156,7 @@ static int sx127x_lora_implicthdr_set(FAR struct sx127x_dev_s *dev,
|
|||
/* Update local variable */
|
||||
|
||||
dev->lora.implicthdr = enable;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -3612,13 +3538,12 @@ static int sx127x_modulation_set(FAR struct sx127x_dev_s *dev,
|
|||
{
|
||||
uint8_t setbits = 0;
|
||||
uint8_t clrbits = 0;
|
||||
int ret = OK;
|
||||
|
||||
wlinfo("modulation_set %d->%d\n", dev->modulation, modulation);
|
||||
|
||||
if (modulation == dev->modulation)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Modulation can be only changed in SLEEP mode */
|
||||
|
|
@ -3662,8 +3587,7 @@ static int sx127x_modulation_set(FAR struct sx127x_dev_s *dev,
|
|||
default:
|
||||
{
|
||||
wlerr("ERROR: Unsupported modulation type %d\n", modulation);
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3690,9 +3614,7 @@ static int sx127x_modulation_set(FAR struct sx127x_dev_s *dev,
|
|||
/* Initial configuration */
|
||||
|
||||
sx127x_modulation_init(dev);
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -3783,7 +3705,6 @@ static bool sx127x_channel_scan(FAR struct sx127x_dev_s *dev,
|
|||
/* Store return value in struct */
|
||||
|
||||
chanscan->free = ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -3831,7 +3752,7 @@ static int sx127x_frequency_set(FAR struct sx127x_dev_s *dev, uint32_t freq)
|
|||
|
||||
if (freq == dev->freq)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* REVISIT: needs sleep/standby mode ? */
|
||||
|
|
@ -3870,10 +3791,8 @@ static int sx127x_frequency_set(FAR struct sx127x_dev_s *dev, uint32_t freq)
|
|||
if (ret < 0)
|
||||
{
|
||||
wlerr("Board-specific freq_select failed %d!\n", ret);
|
||||
goto errout;
|
||||
}
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -3894,7 +3813,7 @@ static int sx127x_power_set(FAR struct sx127x_dev_s *dev, int8_t power)
|
|||
|
||||
if (dev->power == power)
|
||||
{
|
||||
goto errout;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* PA BOOST configuration */
|
||||
|
|
@ -4018,8 +3937,6 @@ static int sx127x_power_set(FAR struct sx127x_dev_s *dev, int8_t power)
|
|||
/* Update local variable */
|
||||
|
||||
dev->power = power;
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -4107,7 +4024,7 @@ static int sx127x_calibration(FAR struct sx127x_dev_s *dev, uint32_t freq)
|
|||
if (ret < 0)
|
||||
{
|
||||
wlerr("ERROR: can't change modulation to FSK\n");
|
||||
goto errout;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* We need standby mode ? */
|
||||
|
|
@ -4146,8 +4063,6 @@ static int sx127x_calibration(FAR struct sx127x_dev_s *dev, uint32_t freq)
|
|||
sx127x_unlock(dev->spi);
|
||||
|
||||
wlinfo("Calibration done\n");
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -4161,8 +4076,8 @@ errout:
|
|||
|
||||
static int sx127x_init(FAR struct sx127x_dev_s *dev)
|
||||
{
|
||||
int ret = OK;
|
||||
uint8_t regval = 0;
|
||||
int ret = OK;
|
||||
uint8_t regval = 0;
|
||||
|
||||
wlinfo("Init sx127x dev\n");
|
||||
|
||||
|
|
@ -4202,8 +4117,7 @@ static int sx127x_init(FAR struct sx127x_dev_s *dev)
|
|||
/* Probably sth wrong with communication */
|
||||
|
||||
wlerr("ERROR: failed to get chip version!\n");
|
||||
ret = -ENODATA;
|
||||
goto errout;
|
||||
return -ENODATA;
|
||||
}
|
||||
|
||||
wlinfo("SX127X version = 0x%02x\n", regval);
|
||||
|
|
@ -4229,7 +4143,7 @@ static int sx127x_init(FAR struct sx127x_dev_s *dev)
|
|||
ret = sx127x_frequency_set(dev, CONFIG_LPWAN_SX127X_RFFREQ_DEFAULT);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto errout;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Configure RF output power - common for FSK/OOK and LORA */
|
||||
|
|
@ -4237,12 +4151,10 @@ static int sx127x_init(FAR struct sx127x_dev_s *dev)
|
|||
ret = sx127x_power_set(dev, CONFIG_LPWAN_SX127X_TXPOWER_DEFAULT);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto errout;
|
||||
return ret;
|
||||
}
|
||||
|
||||
wlinfo("Init sx127x dev - DONE\n");
|
||||
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -4265,7 +4177,6 @@ static int sx127x_deinit(FAR struct sx127x_dev_s *dev)
|
|||
/* Reset radio */
|
||||
|
||||
sx127x_reset(dev);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
@ -4662,21 +4573,21 @@ int sx127x_register(FAR struct spi_dev_s *spi,
|
|||
|
||||
/* Initlaize configuration */
|
||||
|
||||
dev->idle = SX127X_IDLE_OPMODE;
|
||||
dev->idle = SX127X_IDLE_OPMODE;
|
||||
#ifdef CONFIG_LPWAN_SX127X_TXSUPPORT
|
||||
dev->pa_force = lower->pa_force;
|
||||
dev->pa_force = lower->pa_force;
|
||||
#endif
|
||||
dev->crcon = CONFIG_LPWAN_SX127X_CRCON;
|
||||
dev->crcon = CONFIG_LPWAN_SX127X_CRCON;
|
||||
#ifdef CONFIG_LPWAN_SX127X_FSKOOK
|
||||
dev->fskook.fixlen = false;
|
||||
dev->fskook.fixlen = false;
|
||||
#endif
|
||||
#ifdef CONFIG_LPWAN_SX127X_LORA
|
||||
dev->lora.invert_iq = false;
|
||||
dev->lora.invert_iq = false;
|
||||
#endif
|
||||
|
||||
/* Polled file decr */
|
||||
|
||||
dev->pfd = NULL;
|
||||
dev->pfd = NULL;
|
||||
|
||||
/* Initialize sem */
|
||||
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ static uint8_t fifoget(FAR struct nrf24l01_dev_s *dev, FAR uint8_t *buffer,
|
|||
|
||||
dev->fifo_len -= (pktlen + 1);
|
||||
|
||||
no_data:
|
||||
no_data:
|
||||
nxsem_post(&dev->sem_fifo);
|
||||
return pktlen;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -646,7 +646,6 @@ static inline int fat_parselfname(FAR const char **path,
|
|||
}
|
||||
|
||||
errout:
|
||||
|
||||
dirinfo->fd_lfname[0] = '\0';
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -490,7 +490,6 @@ errout_with_semaphore:
|
|||
#endif
|
||||
|
||||
errout_with_inode:
|
||||
|
||||
#if defined(BDFS_SUPPORT) || defined(MDFS_SUPPORT)
|
||||
if (drvr_inode != NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1391,7 +1391,6 @@ int nxffs_pack(FAR struct nxffs_volume_s *volume)
|
|||
*/
|
||||
|
||||
start_pack:
|
||||
|
||||
pack.ioblock = nxffs_getblock(volume, iooffset);
|
||||
pack.iooffset = nxffs_getoffset(volume, iooffset, pack.ioblock);
|
||||
volume->froffset = iooffset;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ static int pseudorename(FAR const char *oldpath, FAR struct inode *oldinode,
|
|||
*/
|
||||
|
||||
next_subdir:
|
||||
|
||||
SETUP_SEARCH(&newdesc, newpath, true);
|
||||
ret = inode_find(&newdesc);
|
||||
if (ret >= 0)
|
||||
|
|
@ -333,7 +332,6 @@ static int mountptrename(FAR const char *oldpath, FAR struct inode *oldinode,
|
|||
struct stat buf;
|
||||
|
||||
next_subdir:
|
||||
|
||||
/* Something exists for this directory entry. Do nothing in the
|
||||
* degenerate case where a directory or file is being moved to
|
||||
* itself.
|
||||
|
|
|
|||
|
|
@ -213,7 +213,6 @@ ssize_t nxterm_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
|||
/* Notify all poll/select waiters that they can write to the FIFO */
|
||||
|
||||
errout_without_sem:
|
||||
|
||||
if (nread > 0)
|
||||
{
|
||||
nxterm_pollnotify(priv, POLLOUT);
|
||||
|
|
|
|||
|
|
@ -123,7 +123,8 @@ static FAR const char *findscanset(FAR const char *fmt,
|
|||
{
|
||||
set[c / 8] |= (1 << (c % 8)); /* Take character c */
|
||||
|
||||
doswitch:n = fmt_char(fmt++); /* Examine the next */
|
||||
doswitch:
|
||||
n = fmt_char(fmt++); /* Examine the next */
|
||||
switch (n)
|
||||
{
|
||||
case 0: /* Format ended too soon */
|
||||
|
|
|
|||
|
|
@ -580,7 +580,7 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
|
|||
|
||||
flags &= ~FL_FLTUPP;
|
||||
|
||||
flt_oper:
|
||||
flt_oper:
|
||||
ndigs = 0;
|
||||
if ((flags & FL_PREC) == 0)
|
||||
{
|
||||
|
|
@ -937,7 +937,7 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
|
|||
|
||||
size = strnlen(pnt, (flags & FL_PREC) ? prec : ~0);
|
||||
|
||||
str_lpad:
|
||||
str_lpad:
|
||||
if ((flags & FL_LPAD) == 0)
|
||||
{
|
||||
while (size < width)
|
||||
|
|
|
|||
|
|
@ -245,7 +245,6 @@ int setvbuf(FAR FILE *stream, FAR char *buffer, int mode, size_t size)
|
|||
/* Update the stream flags and return success */
|
||||
|
||||
reuse_buffer:
|
||||
|
||||
stream->fs_flags = flags;
|
||||
lib_give_semaphore(stream);
|
||||
return OK;
|
||||
|
|
|
|||
|
|
@ -172,11 +172,11 @@ static FAR const unsigned char *_strptime(FAR const unsigned char *buf,
|
|||
goto literal;
|
||||
}
|
||||
|
||||
again:
|
||||
again:
|
||||
switch (c = *fmt++)
|
||||
{
|
||||
case '%': /* "%%" is converted to "%". */
|
||||
literal:
|
||||
literal:
|
||||
if (c != *bp++)
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -176,9 +176,9 @@ static uint16_t bluetooth_sendto_eventhandler(FAR struct net_driver_s *dev,
|
|||
|
||||
/* Don't allow any further call backs. */
|
||||
|
||||
pstate->is_cb->flags = 0;
|
||||
pstate->is_cb->priv = NULL;
|
||||
pstate->is_cb->event = NULL;
|
||||
pstate->is_cb->flags = 0;
|
||||
pstate->is_cb->priv = NULL;
|
||||
pstate->is_cb->event = NULL;
|
||||
|
||||
/* Wake up the waiting thread */
|
||||
|
||||
|
|
@ -191,10 +191,10 @@ errout:
|
|||
|
||||
/* Don't allow any further call backs. */
|
||||
|
||||
pstate->is_cb->flags = 0;
|
||||
pstate->is_cb->priv = NULL;
|
||||
pstate->is_cb->event = NULL;
|
||||
pstate->is_sent = ret;
|
||||
pstate->is_cb->flags = 0;
|
||||
pstate->is_cb->priv = NULL;
|
||||
pstate->is_cb->event = NULL;
|
||||
pstate->is_sent = ret;
|
||||
|
||||
/* Wake up the waiting thread */
|
||||
|
||||
|
|
|
|||
|
|
@ -361,7 +361,6 @@ void icmp_input(FAR struct net_driver_s *dev)
|
|||
return;
|
||||
|
||||
typeerr:
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.icmp.typeerr++;
|
||||
#endif
|
||||
|
|
@ -369,7 +368,6 @@ typeerr:
|
|||
#ifdef CONFIG_NET_ICMP_SOCKET
|
||||
drop:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
g_netstats.icmp.drop++;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -375,7 +375,6 @@ errout_with_halfduplex:
|
|||
/* Release our reference to the half duplex FIFO */
|
||||
|
||||
local_release_halfduplex(conn);
|
||||
|
||||
return ret;
|
||||
#else
|
||||
return -EISCONN;
|
||||
|
|
|
|||
|
|
@ -538,7 +538,6 @@ reset:
|
|||
return;
|
||||
|
||||
found:
|
||||
|
||||
flags = 0;
|
||||
|
||||
/* We do a very naive form of TCP reset processing; we just accept
|
||||
|
|
|
|||
|
|
@ -186,7 +186,6 @@ irqstate_t enter_critical_section(void)
|
|||
*/
|
||||
|
||||
try_again:
|
||||
|
||||
ret = up_irq_save();
|
||||
|
||||
/* Verify that the system has sufficiently initialized so that the task
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ bool nxsched_merge_pending(void)
|
|||
{
|
||||
/* The pending task list is empty */
|
||||
|
||||
goto errout;
|
||||
return false;
|
||||
}
|
||||
|
||||
cpu = nxsched_select_cpu(ALL_CPUS); /* REVISIT: Maybe ptcb->affinity */
|
||||
|
|
@ -272,7 +272,6 @@ bool nxsched_merge_pending(void)
|
|||
}
|
||||
|
||||
errout:
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_SMP */
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ void nxsched_merge_prioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2,
|
|||
{
|
||||
/* Special case.. list1 is empty. There is nothing to be done. */
|
||||
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Now the TCBs are no longer accessible and we can change the state on
|
||||
|
|
@ -108,7 +108,7 @@ void nxsched_merge_prioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2,
|
|||
/* Special case.. list2 is empty. Move list1 to list2. */
|
||||
|
||||
dq_move(&clone, list2);
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Now loop until all entries from list1 have been merged into list2. tcb1
|
||||
|
|
@ -157,8 +157,4 @@ void nxsched_merge_prioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2,
|
|||
}
|
||||
}
|
||||
while (tcb1 != NULL);
|
||||
|
||||
out:
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -397,7 +397,6 @@ int nx_waitid(int idtype, id_t id, FAR siginfo_t *info, int options)
|
|||
}
|
||||
|
||||
errout:
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
leave_critical_section(flags);
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -156,7 +156,6 @@ pid_t nx_waitpid(pid_t pid, int *stat_loc, int options)
|
|||
ret = pid;
|
||||
|
||||
errout:
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
leave_critical_section(flags);
|
||||
#else
|
||||
|
|
@ -451,7 +450,6 @@ pid_t nx_waitpid(pid_t pid, int *stat_loc, int options)
|
|||
ret = pid;
|
||||
|
||||
errout:
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
leave_critical_section(flags);
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue