quick proof of concept patch for stable_17.6.x branch. I defined CC_FALLTHROUGH in ch.h for lack of a better place to put it
Code: Select all
diff --git a/demos/AVR/RT-ARDUINOLEONARDO/usbcfg.c b/demos/AVR/RT-ARDUINOLEONARDO/usbcfg.c
index 3cb7b767e..cd45b0196 100644
--- a/demos/AVR/RT-ARDUINOLEONARDO/usbcfg.c
+++ b/demos/AVR/RT-ARDUINOLEONARDO/usbcfg.c
@@ -301,9 +301,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/demos/AVR/RT-PRO_MICRO/usbcfg.c b/demos/AVR/RT-PRO_MICRO/usbcfg.c
index 851c576c4..16d2e3036 100644
--- a/demos/AVR/RT-PRO_MICRO/usbcfg.c
+++ b/demos/AVR/RT-PRO_MICRO/usbcfg.c
@@ -300,9 +300,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/demos/AVR/RT-TEENSY2-USB/usbcfg.c b/demos/AVR/RT-TEENSY2-USB/usbcfg.c
index 979161ae5..783e7a6c9 100644
--- a/demos/AVR/RT-TEENSY2-USB/usbcfg.c
+++ b/demos/AVR/RT-TEENSY2-USB/usbcfg.c
@@ -266,9 +266,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/demos/STM32/RT-STM32F103_INEMO_DISCOVERY/usbcfg.c b/demos/STM32/RT-STM32F103_INEMO_DISCOVERY/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/demos/STM32/RT-STM32F103_INEMO_DISCOVERY/usbcfg.c
+++ b/demos/STM32/RT-STM32F103_INEMO_DISCOVERY/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/demos/STM32/RT-STM32F103-MAPLEMINI/usbcfg.c b/demos/STM32/RT-STM32F103-MAPLEMINI/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/demos/STM32/RT-STM32F103-MAPLEMINI/usbcfg.c
+++ b/demos/STM32/RT-STM32F103-MAPLEMINI/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/demos/STM32/RT-STM32F103-STM3210E_EVAL-FATFS-USB/usbcfg.c b/demos/STM32/RT-STM32F103-STM3210E_EVAL-FATFS-USB/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/demos/STM32/RT-STM32F103-STM3210E_EVAL-FATFS-USB/usbcfg.c
+++ b/demos/STM32/RT-STM32F103-STM3210E_EVAL-FATFS-USB/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/usbcfg.c b/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/usbcfg.c
+++ b/demos/STM32/RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/demos/STM32/RT-STM32F429-DISCOVERY/usbcfg.c b/demos/STM32/RT-STM32F429-DISCOVERY/usbcfg.c
index 5121b03aa..41d688da2 100644
--- a/demos/STM32/RT-STM32F429-DISCOVERY/usbcfg.c
+++ b/demos/STM32/RT-STM32F429-DISCOVERY/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c
index bb05f43c8..e6cd5a863 100644
--- a/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c
+++ b/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-FATFS-USB/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/os/hal/ports/AVR/hal_spi_lld.c b/os/hal/ports/AVR/hal_spi_lld.c
index a9bb13228..4bb08d9b8 100644
--- a/os/hal/ports/AVR/hal_spi_lld.c
+++ b/os/hal/ports/AVR/hal_spi_lld.c
@@ -136,7 +136,8 @@ void spi_lld_start(SPIDriver *spip) {
case SPI_LSB_FIRST:
SPCR |= (1 << DORD);
break;
- case SPI_MSB_FIRST: /* fallthrough */
+ case SPI_MSB_FIRST:
+ CC_FALLTHROUGH;
default:
SPCR &= ~(1 << DORD);
break;
@@ -153,7 +154,8 @@ void spi_lld_start(SPIDriver *spip) {
case SPI_MODE_3:
SPCR |= ((1 << CPOL) | (1 << CPHA));
break;
- case SPI_MODE_0: /* fallthrough */
+ case SPI_MODE_0:
+ CC_FALLTHROUGH;
default: break;
}
@@ -180,7 +182,8 @@ void spi_lld_start(SPIDriver *spip) {
case SPI_SCK_FOSC_128:
SPCR |= ((1 << SPR1) | (1 << SPR0));
break;
- case SPI_SCK_FOSC_4: /* fallthrough */
+ case SPI_SCK_FOSC_4:
+ CC_FALLTHROUGH;
default: break;
}
diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c b/os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c
index 279170e16..13facc4f4 100644
--- a/os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c
+++ b/os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c
@@ -519,40 +519,40 @@ void pwm_lld_start(PWMDriver *pwmp) {
switch (pwmp->config->channels[0].mode & PWM_OUTPUT_MASK) {
case PWM_OUTPUT_ACTIVE_LOW:
ccer |= STM32_TIM_CCER_CC1P;
- /* Falls through.*/
+ CC_FALLTHROUGH;
case PWM_OUTPUT_ACTIVE_HIGH:
ccer |= STM32_TIM_CCER_CC1E;
- /* Falls through.*/
+ CC_FALLTHROUGH;
default:
;
}
switch (pwmp->config->channels[1].mode & PWM_OUTPUT_MASK) {
case PWM_OUTPUT_ACTIVE_LOW:
ccer |= STM32_TIM_CCER_CC2P;
- /* Falls through.*/
+ CC_FALLTHROUGH;
case PWM_OUTPUT_ACTIVE_HIGH:
ccer |= STM32_TIM_CCER_CC2E;
- /* Falls through.*/
+ CC_FALLTHROUGH;
default:
;
}
switch (pwmp->config->channels[2].mode & PWM_OUTPUT_MASK) {
case PWM_OUTPUT_ACTIVE_LOW:
ccer |= STM32_TIM_CCER_CC3P;
- /* Falls through.*/
+ CC_FALLTHROUGH;
case PWM_OUTPUT_ACTIVE_HIGH:
ccer |= STM32_TIM_CCER_CC3E;
- /* Falls through.*/
+ CC_FALLTHROUGH;
default:
;
}
switch (pwmp->config->channels[3].mode & PWM_OUTPUT_MASK) {
case PWM_OUTPUT_ACTIVE_LOW:
ccer |= STM32_TIM_CCER_CC4P;
- /* Falls through.*/
+ CC_FALLTHROUGH;
case PWM_OUTPUT_ACTIVE_HIGH:
ccer |= STM32_TIM_CCER_CC4E;
- /* Falls through.*/
+ CC_FALLTHROUGH;
default:
;
}
@@ -569,30 +569,30 @@ void pwm_lld_start(PWMDriver *pwmp) {
switch (pwmp->config->channels[0].mode & PWM_COMPLEMENTARY_OUTPUT_MASK) {
case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW:
ccer |= STM32_TIM_CCER_CC1NP;
- /* Falls through.*/
+ CC_FALLTHROUGH;
case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH:
ccer |= STM32_TIM_CCER_CC1NE;
- /* Falls through.*/
+ CC_FALLTHROUGH;
default:
;
}
switch (pwmp->config->channels[1].mode & PWM_COMPLEMENTARY_OUTPUT_MASK) {
case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW:
ccer |= STM32_TIM_CCER_CC2NP;
- /* Falls through.*/
+ CC_FALLTHROUGH;
case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH:
ccer |= STM32_TIM_CCER_CC2NE;
- /* Falls through.*/
+ CC_FALLTHROUGH;
default:
;
}
switch (pwmp->config->channels[2].mode & PWM_COMPLEMENTARY_OUTPUT_MASK) {
case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_LOW:
ccer |= STM32_TIM_CCER_CC3NP;
- /* Falls through.*/
+ CC_FALLTHROUGH;
case PWM_COMPLEMENTARY_OUTPUT_ACTIVE_HIGH:
ccer |= STM32_TIM_CCER_CC3NE;
- /* Falls through.*/
+ CC_FALLTHROUGH;
default:
;
}
diff --git a/os/hal/src/hal_usb.c b/os/hal/src/hal_usb.c
index 314473f89..a9ab95ca0 100644
--- a/os/hal/src/hal_usb.c
+++ b/os/hal/src/hal_usb.c
@@ -892,7 +892,7 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) {
usbp->ep0state = USB_EP0_IN_WAITING_TX0;
return;
}
- /* Falls into, it is intentional.*/
+ CC_FALLTHROUGH;
case USB_EP0_IN_WAITING_TX0:
/* Transmit phase over, receiving the zero sized status packet.*/
usbp->ep0state = USB_EP0_OUT_WAITING_STS;
@@ -916,7 +916,7 @@ void _usb_ep0in(USBDriver *usbp, usbep_t ep) {
case USB_EP0_OUT_RX:
/* All the above are invalid states in the IN phase.*/
osalDbgAssert(false, "EP0 state machine error");
- /* Falling through is intentional.*/
+ CC_FALLTHROUGH;
case USB_EP0_ERROR:
/* Error response, the state machine goes into an error state, the low
level layer will have to reset it to USB_EP0_WAITING_SETUP after
@@ -975,7 +975,7 @@ void _usb_ep0out(USBDriver *usbp, usbep_t ep) {
case USB_EP0_IN_SENDING_STS:
/* All the above are invalid states in the IN phase.*/
osalDbgAssert(false, "EP0 state machine error");
- /* Falling through is intentional.*/
+ CC_FALLTHROUGH;
case USB_EP0_ERROR:
/* Error response, the state machine goes into an error state, the low
level layer will have to reset it to USB_EP0_WAITING_SETUP after
diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h
index 430612792..8b14b2283 100644
--- a/os/rt/include/ch.h
+++ b/os/rt/include/ch.h
@@ -66,6 +66,18 @@
#define CH_KERNEL_PATCH 3
/** @} */
+#if defined(__GNUC__) && __GNUC__ >= 7
+/**
+ * @brief Annotate an explicit case statement fallthrough
+ */
+#define CC_FALLTHROUGH __attribute__((fallthrough))
+#else
+/**
+ * @brief Annotate an explicit case statement fallthrough
+ */
+#define CC_FALLTHROUGH
+#endif
+
/* Core headers.*/
#include "chtypes.h"
#include "chconf.h"
diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c
index 844c7c52b..813b60d42 100644
--- a/os/rt/src/chschd.c
+++ b/os/rt/src/chschd.c
@@ -332,11 +332,11 @@ static void wakeup(void *p) {
#if CH_CFG_USE_SEMAPHORES == TRUE
case CH_STATE_WTSEM:
chSemFastSignalI(tp->u.wtsemp);
+ CC_FALLTHROUGH;
#endif
- /* Falls through.*/
case CH_STATE_QUEUED:
- /* Falls through.*/
#if (CH_CFG_USE_CONDVARS == TRUE) && (CH_CFG_USE_CONDVARS_TIMEOUT == TRUE)
+ CC_FALLTHROUGH;
case CH_STATE_WTCOND:
#endif
/* States requiring dequeuing.*/
diff --git a/testex/STM32/STM32F3xx/I2C-LSM303DLHC/usbcfg.c b/testex/STM32/STM32F3xx/I2C-LSM303DLHC/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testex/STM32/STM32F3xx/I2C-LSM303DLHC/usbcfg.c
+++ b/testex/STM32/STM32F3xx/I2C-LSM303DLHC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testex/STM32/STM32F3xx/SPI-L3GD20/usbcfg.c b/testex/STM32/STM32F3xx/SPI-L3GD20/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testex/STM32/STM32F3xx/SPI-L3GD20/usbcfg.c
+++ b/testex/STM32/STM32F3xx/SPI-L3GD20/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testex/STM32/STM32F4xx/I2C-LSM303DLHC/usbcfg.c b/testex/STM32/STM32F4xx/I2C-LSM303DLHC/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testex/STM32/STM32F4xx/I2C-LSM303DLHC/usbcfg.c
+++ b/testex/STM32/STM32F4xx/I2C-LSM303DLHC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testex/STM32/STM32F4xx/SPI-L3GD20/usbcfg.c b/testex/STM32/STM32F4xx/SPI-L3GD20/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testex/STM32/STM32F4xx/SPI-L3GD20/usbcfg.c
+++ b/testex/STM32/STM32F4xx/SPI-L3GD20/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testex/STM32/STM32F4xx/SPI-LIS3DSH/usbcfg.c b/testex/STM32/STM32F4xx/SPI-LIS3DSH/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testex/STM32/STM32F4xx/SPI-LIS3DSH/usbcfg.c
+++ b/testex/STM32/STM32F4xx/SPI-LIS3DSH/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testex/STM32/STM32F4xx/SPI-LIS302DL/usbcfg.c b/testex/STM32/STM32F4xx/SPI-LIS302DL/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testex/STM32/STM32F4xx/SPI-LIS302DL/usbcfg.c
+++ b/testex/STM32/STM32F4xx/SPI-LIS302DL/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F0xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F0xx/USB_CDC/usbcfg.c
index 558334fb5..f5fed7f45 100644
--- a/testhal/STM32/STM32F0xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F0xx/USB_CDC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F1xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F1xx/USB_CDC/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testhal/STM32/STM32F1xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F1xx/USB_CDC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F1xx/USB_CDC_F107/usbcfg.c b/testhal/STM32/STM32F1xx/USB_CDC_F107/usbcfg.c
index db05bbd8a..af01809e2 100755
--- a/testhal/STM32/STM32F1xx/USB_CDC_F107/usbcfg.c
+++ b/testhal/STM32/STM32F1xx/USB_CDC_F107/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F2xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F2xx/USB_CDC/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testhal/STM32/STM32F2xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F2xx/USB_CDC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F3xx/USB_CDC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c b/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c
index 9559e1f43..4aa1b5b16 100644
--- a/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c
+++ b/testhal/STM32/STM32F3xx/USB_CDC_IAD/usbcfg.c
@@ -398,9 +398,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F4xx/USB_CDC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c b/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c
index d1249b305..6882bd509 100644
--- a/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c
+++ b/testhal/STM32/STM32F4xx/USB_CDC_IAD/usbcfg.c
@@ -398,9 +398,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
index bb05f43c8..e6cd5a863 100644
--- a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32F37x/USB_CDC/usbcfg.c b/testhal/STM32/STM32F37x/USB_CDC/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testhal/STM32/STM32F37x/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F37x/USB_CDC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();
diff --git a/testhal/STM32/STM32L4xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32L4xx/USB_CDC/usbcfg.c
index db05bbd8a..af01809e2 100644
--- a/testhal/STM32/STM32L4xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32L4xx/USB_CDC/usbcfg.c
@@ -284,9 +284,9 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
chSysUnlockFromISR();
return;
case USB_EVENT_RESET:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_UNCONFIGURED:
- /* Falls into.*/
+ CC_FALLTHROUGH;
case USB_EVENT_SUSPEND:
chSysLockFromISR();