arch: Convert DEBUGASSERT(false) into more intuitive DEBUGPANIC()

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
Gustavo Henrique Nihei
2022-07-13 14:34:12 -03:00
committed by Xiang Xiao
parent 9695659620
commit e24621d545
62 changed files with 136 additions and 136 deletions
+1 -1
View File
@@ -291,7 +291,7 @@ static int set_gpioint_config(int slot, uint32_t gpiocfg)
val |= (INT_ROUTE_PMU_LATCH << shift);
break;
default:
DEBUGASSERT(0);
DEBUGPANIC();
break;
}
+1 -1
View File
@@ -433,7 +433,7 @@ int __ramfunc__ msc_load_write_data(uint32_t *data, uint32_t num_words,
/* Gecko does not have auto-increment of ADDR. */
DEBUGASSERT(0);
DEBUGPANIC();
#else
/* Requires a system core clock at 14MHz or higher */
+2 -2
View File
@@ -396,7 +396,7 @@ static int pwm_timer(struct efm32_pwmtimer_s *priv,
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
}
pwm_putreg(priv, EFM32_TIMER_ROUTE_OFFSET, regval);
@@ -618,7 +618,7 @@ static int pwm_setup(struct pwm_lowerhalf_s *dev)
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
break;
}
+1 -1
View File
@@ -1645,7 +1645,7 @@ static void efm32_transfer_start(struct efm32_usbhost_s *priv, int chidx)
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
return;
}
+1 -1
View File
@@ -152,7 +152,7 @@ void lc823450_clockconfig()
}
else
{
DEBUGASSERT(false);
DEBUGPANIC();
}
#endif
+2 -2
View File
@@ -325,7 +325,7 @@ int lc823450_gpio_config(uint16_t gpiocfg)
pupd = IOEX_PUPD_PULLDOWN;
break;
default:
DEBUGASSERT(0);
DEBUGPANIC();
return -EINVAL;
}
}
@@ -467,7 +467,7 @@ bool lc823450_gpio_read(uint16_t gpiocfg)
#endif /* CONFIG_IOEX */
else
{
DEBUGASSERT(0);
DEBUGPANIC();
}
return value;
+2 -2
View File
@@ -1108,7 +1108,7 @@ struct i2c_master_s *lc823450_i2cbus_initialize(int port)
break;
#endif
default:
DEBUGASSERT(false);
DEBUGPANIC();
return NULL;
}
@@ -1180,7 +1180,7 @@ int lc823450_i2cbus_uninitialize(struct i2c_master_s *dev)
if (-1 == port)
{
DEBUGASSERT(0);
DEBUGPANIC();
return -EFAULT;
}
+2 -2
View File
@@ -275,7 +275,7 @@ static void _setup_audio_pll(uint32_t freq)
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
}
/* Set divider */
@@ -369,7 +369,7 @@ static void lc823450_i2s_setchannel(char id, uint8_t ch)
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
break;
}
+1 -1
View File
@@ -719,7 +719,7 @@ void arm_ack_irq(int irq)
{
/* IRQ should be handled on CPU0 */
DEBUGASSERT(false);
DEBUGPANIC();
}
#endif
}
+2 -2
View File
@@ -697,7 +697,7 @@ int lc823450_mtd_initialize(uint32_t devno)
PRIuOFF " nblocks=%" PRIuOFF "\n", __func__,
partinfo[i].startblock, partinfo[i].nblocks);
mtd_semgive(&g_sem);
DEBUGASSERT(0);
DEBUGPANIC();
return -EIO;
}
@@ -707,7 +707,7 @@ int lc823450_mtd_initialize(uint32_t devno)
finfo("%s(): mmcl_initialize part%d failed: %d\n",
__func__, partno, ret);
mtd_semgive(&g_sem);
DEBUGASSERT(0);
DEBUGPANIC();
return ret;
}
}
+1 -1
View File
@@ -272,7 +272,7 @@ int lc823450_sdc_initialize(uint32_t ch)
#endif
default:
DEBUGASSERT(false);
DEBUGPANIC();
}
mcinfo("++++ start\n");
+1 -1
View File
@@ -110,7 +110,7 @@ static int _get_ch_from_cfg(struct sddrcfg_s *cfg)
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
}
return ch;
+2 -2
View File
@@ -236,7 +236,7 @@ static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode)
switch (mode)
{
case SPIDEV_MODE0: /* CPOL=0; CPHA=0 */
DEBUGASSERT(0);
DEBUGPANIC();
break;
case SPIDEV_MODE1: /* CPOL=0; CPHA=1 */
@@ -244,7 +244,7 @@ static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode)
break;
case SPIDEV_MODE2: /* CPOL=1; CPHA=0 */
DEBUGASSERT(0);
DEBUGPANIC();
break;
case SPIDEV_MODE3: /* CPOL=1; CPHA=1 */
+1 -1
View File
@@ -743,7 +743,7 @@ void lpc43_tmrinitialize(const char *devpath, int irq)
#endif
default:
DEBUGASSERT(0);
DEBUGPANIC();
}
priv->ops = &g_tmrops;
+1 -1
View File
@@ -354,7 +354,7 @@ static int nrf52_i2c_transfer(struct i2c_master_s *dev,
{
/* Not supported */
DEBUGASSERT(0);
DEBUGPANIC();
}
}
#endif
+1 -1
View File
@@ -212,7 +212,7 @@ static void nrf52_setbaud(uintptr_t base, const struct uart_config_s *config)
default:
{
DEBUGASSERT(0);
DEBUGPANIC();
break;
}
}
+1 -1
View File
@@ -850,7 +850,7 @@ static void nrf52_spi_setmode(struct spi_dev_s *dev,
default:
{
DEBUGASSERT(0);
DEBUGPANIC();
return;
}
}
+1 -1
View File
@@ -825,7 +825,7 @@ static void rp2040_handle_zlp(struct rp2040_usbdev_s *priv)
break;
default:
DEBUGASSERT(0);
DEBUGPANIC();
}
usbtrace(TRACE_INTDECODE(RP2040_TRACEINTID_HANDLEZLP), privep->ep.eplog);
+6 -6
View File
@@ -1881,7 +1881,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain,
{
/* error */
DEBUGASSERT(false);
DEBUGPANIC();
}
}
@@ -1891,7 +1891,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain,
{
/* error */
DEBUGASSERT(false);
DEBUGPANIC();
}
/* calculate the new clock ticks */
@@ -2020,7 +2020,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain,
{
/* error */
DEBUGASSERT(false);
DEBUGPANIC();
}
}
@@ -2030,7 +2030,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain,
{
/* error */
DEBUGASSERT(false);
DEBUGPANIC();
}
#endif /* CONFIG_RUN_STANDBY */
@@ -2218,7 +2218,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain,
{
/* error */
DEBUGASSERT(false);
DEBUGPANIC();
}
}
@@ -2228,7 +2228,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain,
{
/* error */
DEBUGASSERT(false);
DEBUGPANIC();
}
#endif /* CONFIG_RUN_SLEEP */
+1 -1
View File
@@ -634,7 +634,7 @@ void sam_tcinitialize(const char *devpath, int irq)
#endif
default:
DEBUGASSERT(0);
DEBUGPANIC();
}
priv->ops = &g_tcops;
+1 -1
View File
@@ -564,7 +564,7 @@ static xcpt_t sam34_capture(struct watchdog_lowerhalf_s *lower,
return oldhandler;
#endif
DEBUGASSERT(0);
DEBUGPANIC();
return NULL;
}
+2 -2
View File
@@ -1294,7 +1294,7 @@ errout:
}
else
{
DEBUGASSERT(0);
DEBUGPANIC();
}
return ret;
@@ -1361,7 +1361,7 @@ static int stm32can_rxinterrupt(struct stm32_can_s *priv, int rxmb)
}
else
{
DEBUGASSERT(0);
DEBUGPANIC();
}
return OK;
+1 -1
View File
@@ -1660,7 +1660,7 @@ static int stm32_foc_adc_handler(int irq, void *context, void *arg)
ret = foc_dev->adc_isr(dev);
if (ret < 0)
{
DEBUGASSERT(0);
DEBUGPANIC();
}
}
+1 -1
View File
@@ -2708,7 +2708,7 @@ static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->sem_excl, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -1567,7 +1567,7 @@ static void stm32_transfer_start(struct stm32_usbhost_s *priv, int chidx)
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
return;
}
+1 -1
View File
@@ -1568,7 +1568,7 @@ static void stm32_transfer_start(struct stm32_usbhost_s *priv, int chidx)
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
return;
}
+4 -4
View File
@@ -441,7 +441,7 @@ void up_timer_initialize(void)
/* Basic timers not supported by this implementation */
DEBUGASSERT(0);
DEBUGPANIC();
break;
#endif
@@ -450,7 +450,7 @@ void up_timer_initialize(void)
/* Basic timers not supported by this implementation */
DEBUGASSERT(0);
DEBUGPANIC();
break;
#endif
@@ -511,7 +511,7 @@ void up_timer_initialize(void)
#endif
default:
DEBUGASSERT(0);
DEBUGPANIC();
}
/* Get the TC frequency that corresponds to the requested resolution */
@@ -530,7 +530,7 @@ void up_timer_initialize(void)
if (!g_tickless.tch)
{
tmrerr("ERROR: Failed to allocate TIM%d\n", g_tickless.timer);
DEBUGASSERT(0);
DEBUGPANIC();
}
STM32_TIM_SETCLOCK(g_tickless.tch, g_tickless.frequency);
+1 -1
View File
@@ -2719,7 +2719,7 @@ static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->sem_excl, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -1619,7 +1619,7 @@ static int spi_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->exclsem, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -2745,7 +2745,7 @@ static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->sem_excl, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -1553,7 +1553,7 @@ static void stm32_transfer_start(struct stm32_usbhost_s *priv, int chidx)
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
return;
}
+1 -1
View File
@@ -2078,7 +2078,7 @@ static int spi_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->exclsem, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+4 -4
View File
@@ -474,7 +474,7 @@ void up_timer_initialize(void)
/* Basic timers not supported by this implementation */
DEBUGASSERT(0);
DEBUGPANIC();
break;
#endif
@@ -483,7 +483,7 @@ void up_timer_initialize(void)
/* Basic timers not supported by this implementation */
DEBUGASSERT(0);
DEBUGPANIC();
break;
#endif
@@ -560,7 +560,7 @@ void up_timer_initialize(void)
#endif
default:
DEBUGASSERT(0);
DEBUGPANIC();
}
/* Get the TC frequency that corresponds to the requested resolution */
@@ -579,7 +579,7 @@ void up_timer_initialize(void)
if (!g_tickless.tch)
{
tmrerr("ERROR: Failed to allocate TIM%d\n", g_tickless.timer);
DEBUGASSERT(0);
DEBUGPANIC();
}
STM32_TIM_SETCLOCK(g_tickless.tch, g_tickless.frequency);
+1 -1
View File
@@ -2709,7 +2709,7 @@ static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->sem_excl, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -1556,7 +1556,7 @@ static void stm32_transfer_start(struct stm32_usbhost_s *priv, int chidx)
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
return;
}
+1 -1
View File
@@ -2395,7 +2395,7 @@ static int spi_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->exclsem, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -1568,7 +1568,7 @@ static int spi_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_getvalue(&priv->exclsem, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+2 -2
View File
@@ -528,7 +528,7 @@ void up_timer_initialize(void)
#endif
default:
DEBUGASSERT(0);
DEBUGPANIC();
}
/* Get the TC frequency that corresponds to the requested resolution */
@@ -547,7 +547,7 @@ void up_timer_initialize(void)
if (g_tickless.tch == NULL)
{
tmrerr("ERROR: Failed to allocate TIM%d\n", g_tickless.timer);
DEBUGASSERT(0);
DEBUGPANIC();
}
STM32_TIM_SETCLOCK(g_tickless.tch, g_tickless.frequency);
+1 -1
View File
@@ -1155,7 +1155,7 @@ static int stm32_1wire_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->sem_excl, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -2919,7 +2919,7 @@ static int stm32l4_i2c_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->sem_excl, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -1570,7 +1570,7 @@ static void stm32l4_transfer_start(struct stm32l4_usbhost_s *priv,
break;
default:
DEBUGASSERT(false);
DEBUGPANIC();
return;
}
+1 -1
View File
@@ -1670,7 +1670,7 @@ static int spi_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->exclsem, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -1673,7 +1673,7 @@ static int spi_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_getvalue(&priv->exclsem, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+1 -1
View File
@@ -2137,7 +2137,7 @@ static int spi_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->exclsem, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
+2 -2
View File
@@ -2556,7 +2556,7 @@ static void stm32wb_serial_pmnotify(struct pm_callback_s *cb, int domain,
break;
default:
DEBUGASSERT(0);
DEBUGPANIC();
break;
}
}
@@ -2657,7 +2657,7 @@ static int stm32wb_serial_pmprepare(struct pm_callback_s *cb, int domain,
break;
default:
DEBUGASSERT(0);
DEBUGPANIC();
break;
}
+2 -2
View File
@@ -1607,7 +1607,7 @@ static int spi_pm_prepare(struct pm_callback_s *cb, int domain,
if (nxsem_get_value(&priv->exclsem, &sval) < 0)
{
DEBUGASSERT(false);
DEBUGPANIC();
return -EINVAL;
}
@@ -1623,7 +1623,7 @@ static int spi_pm_prepare(struct pm_callback_s *cb, int domain,
break;
default:
DEBUGASSERT(0);
DEBUGPANIC();
break;
}
+2 -2
View File
@@ -385,7 +385,7 @@ void up_timer_initialize(void)
#endif
default:
DEBUGASSERT(0);
DEBUGPANIC();
}
/* Get the TC frequency that corresponds to the requested resolution */
@@ -404,7 +404,7 @@ void up_timer_initialize(void)
if (!g_tickless.tch)
{
tmrerr("ERROR: Failed to allocate TIM%d\n", g_tickless.timer);
DEBUGASSERT(0);
DEBUGPANIC();
}
STM32WB_TIM_SETCLOCK(g_tickless.tch, g_tickless.frequency);
+1 -1
View File
@@ -665,7 +665,7 @@ static void uart_dma_send(uart_priv_t *priv, char *buf, size_t len)
if (len + DMA_HEAD_LEN > priv->txdmasize)
{
DEBUGASSERT(false);
DEBUGPANIC();
return;
}
+2 -2
View File
@@ -1218,7 +1218,7 @@ void bl_os_irq_attach(int32_t n, void *f, void *arg)
if (!adapter)
{
DEBUGASSERT(0);
DEBUGPANIC();
}
adapter->func = f;
@@ -1228,7 +1228,7 @@ void bl_os_irq_attach(int32_t n, void *f, void *arg)
if (ret != OK)
{
DEBUGASSERT(0);
DEBUGPANIC();
}
}
@@ -827,7 +827,7 @@ static void semphr_delete_wrapper(void *semphr)
static int semphr_take_from_isr_wrapper(void *semphr, void *hptw)
{
DEBUGASSERT(0);
DEBUGPANIC();
return false;
}
@@ -1183,7 +1183,7 @@ static int IRAM_ATTR queue_send_from_isr_wrapper(void *queue,
static int queue_recv_from_isr_wrapper(void *queue, void *item, void *hptw)
{
DEBUGASSERT(0);
DEBUGPANIC();
return false;
}
@@ -1537,7 +1537,7 @@ static void btdm_sleep_enter_phase1_wrapper(uint32_t lpcycles)
else
{
wlerr("timer start failed");
DEBUGASSERT(0);
DEBUGPANIC();
}
}
@@ -1566,7 +1566,7 @@ static void btdm_sleep_enter_phase2_wrapper(void)
}
else
{
DEBUGASSERT(0);
DEBUGPANIC();
}
if (g_lp_stat.pm_lock_released == false)
@@ -1602,7 +1602,7 @@ static void btdm_sleep_exit_phase3_wrapper(void)
if (btdm_sleep_clock_sync())
{
wlerr("sleep eco state err\n");
DEBUGASSERT(0);
DEBUGPANIC();
}
if (btdm_controller_get_sleep_mode() == ESP_BT_SLEEP_MODE_1)
@@ -2154,7 +2154,7 @@ int esp32c3_bt_controller_deinit(void)
}
else
{
DEBUGASSERT(0);
DEBUGPANIC();
}
#ifdef CONFIG_PM
@@ -2230,7 +2230,7 @@ int esp32c3_bt_controller_disable(void)
}
else
{
DEBUGASSERT(0);
DEBUGPANIC();
}
#endif

Some files were not shown because too many files have changed in this diff Show More