assert: switch from ASSERT(0/false) to PANIC

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2023-01-25 23:53:57 +02:00 committed by Xiang Xiao
parent 1280a2a8f9
commit f952b8456c
16 changed files with 33 additions and 29 deletions

View File

@ -552,7 +552,8 @@ void cxd56_timer_initialize(const char *devpath, int timer)
break; break;
default: default:
ASSERT(0); PANIC();
break;
} }
priv->ops = &g_tmrops; priv->ops = &g_tmrops;

View File

@ -1882,7 +1882,7 @@ static int imxrt_attach(struct sdio_dev_s *dev)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }

View File

@ -1032,7 +1032,7 @@ static int nrf52_radio_isr(int irq, void *context, void *arg)
default: default:
{ {
ASSERT(0); PANIC();
break; break;
} }
} }

View File

@ -1997,7 +1997,7 @@ static int sam_attach(struct sdio_dev_s *dev)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }

View File

@ -2246,7 +2246,7 @@ void weak_function arm_dma_initialize(void)
default: default:
{ {
ASSERT(0); PANIC();
break; break;
} }
} }

View File

@ -132,7 +132,7 @@ void up_disable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }
@ -174,7 +174,7 @@ void up_enable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }

View File

@ -2958,7 +2958,7 @@ void IRAM_ATTR esp32c3_rtc_clk_cpu_freq_get_config(
} }
else else
{ {
ASSERT(0); PANIC();
} }
} }
break; break;
@ -2973,7 +2973,8 @@ void IRAM_ATTR esp32c3_rtc_clk_cpu_freq_get_config(
break; break;
default: default:
ASSERT(0); PANIC();
break;
} }
*out_config = (struct esp32c3_cpu_freq_config_s) *out_config = (struct esp32c3_cpu_freq_config_s)

View File

@ -78,7 +78,7 @@ uint32_t fe310_get_hfclk(void)
/* TODO: HFROSC */ /* TODO: HFROSC */
ASSERT(false); PANIC();
out: out:
return freq; return freq;

View File

@ -119,7 +119,7 @@ void up_disable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }
@ -155,7 +155,7 @@ void up_enable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }

View File

@ -137,7 +137,7 @@ void up_disable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }
@ -179,7 +179,7 @@ void up_enable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }

View File

@ -114,7 +114,7 @@ void up_disable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }
@ -159,7 +159,7 @@ void up_enable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }

View File

@ -138,7 +138,7 @@ void up_disable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }
@ -181,7 +181,7 @@ void up_enable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }

View File

@ -131,7 +131,7 @@ void up_disable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }
@ -181,7 +181,7 @@ void up_enable_irq(int irq)
} }
else else
{ {
ASSERT(false); PANIC();
} }
} }
} }

View File

@ -274,7 +274,8 @@ static enum pkt_type_e _spi_err_to_pkt_type(enum spi_status_e s)
default: default:
r = TYPE_UNMATCH; r = TYPE_UNMATCH;
ASSERT(false); PANIC();
break;
} }
return r; return r;
@ -303,7 +304,7 @@ static uint8_t _cid_to_uint8(char c)
else else
{ {
ret = 0xff; ret = 0xff;
ASSERT(false); PANIC();
} }
return ret; return ret;
@ -1191,7 +1192,7 @@ static void _parse_pkt_in_s2(FAR struct pkt_ctx_s *pkt_ctx,
else else
{ {
wlerr("** <ESC>%c not supported\n", c); wlerr("** <ESC>%c not supported\n", c);
ASSERT(false); PANIC();
} }
} }
@ -1352,7 +1353,7 @@ static enum pkt_type_e _parse_pkt(FAR uint8_t *p, uint16_t len,
break; break;
default: default:
ASSERT(false); PANIC();
break; break;
} }
} }
@ -1882,7 +1883,7 @@ gs2200m_create_clnt(FAR struct gs2200m_dev_s *dev,
} }
else else
{ {
ASSERT(false); PANIC();
} }
/* Initialize pkt_dat and send */ /* Initialize pkt_dat and send */
@ -2352,8 +2353,9 @@ static int gs2200m_ioctl_connect(FAR struct gs2200m_dev_s *dev,
default: default:
wlerr("+++ error: type=%d\n", type); wlerr("+++ error: type=%d\n", type);
ASSERT(false); PANIC();
ret = -EINVAL; ret = -EINVAL;
break;
} }
wlinfo("++ end: cid=%c (type=%d,ret=%d)\n", cid, type, ret); wlinfo("++ end: cid=%c (type=%d,ret=%d)\n", cid, type, ret);

View File

@ -1121,7 +1121,7 @@ static int sx127x_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case SX127XIOC_SYNCWORDSET: case SX127XIOC_SYNCWORDSET:
{ {
ASSERT(0); PANIC();
sx127x_syncword_set(dev, NULL, 0); sx127x_syncword_set(dev, NULL, 0);
break; break;
} }
@ -1130,7 +1130,7 @@ static int sx127x_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
case SX127XIOC_SYNCWORDGET: case SX127XIOC_SYNCWORDGET:
{ {
ASSERT(0); PANIC();
sx127x_syncword_get(dev, NULL, 0); sx127x_syncword_get(dev, NULL, 0);
break; break;
} }

View File

@ -563,7 +563,7 @@ int up_relocateadd(const Elf_Rela *rel, const Elf_Sym *sym,
default: default:
berr("ERROR: Unsupported relocation: %ld\n", berr("ERROR: Unsupported relocation: %ld\n",
ARCH_ELF_RELTYPE(rel->r_info)); ARCH_ELF_RELTYPE(rel->r_info));
ASSERT(false); PANIC();
return -EINVAL; return -EINVAL;
} }