diff mbox series

[RFC,v3,70/78] hw/rtc: add fallthrough pseudo-keyword

Message ID 7bad24a9243a3d9f0190e2f89c86aa68816de5d6.1697186560.git.manos.pitsidianakis@linaro.org (mailing list archive)
State New, archived
Headers show
Series Strict disable implicit fallthrough | expand

Commit Message

Manos Pitsidianakis Oct. 13, 2023, 8:46 a.m. UTC
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.

Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
 hw/rtc/aspeed_rtc.c  | 4 ++--
 hw/rtc/mc146818rtc.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Cédric Le Goater Oct. 13, 2023, 12:53 p.m. UTC | #1
On 10/13/23 10:46, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
> 
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>


Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.



> ---
>   hw/rtc/aspeed_rtc.c  | 4 ++--
>   hw/rtc/mc146818rtc.c | 4 ++--
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
> index fa861e2d49..59c64b01b9 100644
> --- a/hw/rtc/aspeed_rtc.c
> +++ b/hw/rtc/aspeed_rtc.c
> @@ -78,7 +78,7 @@ static uint64_t aspeed_rtc_read(void *opaque, hwaddr addr,
>           if (rtc->reg[CONTROL] & RTC_ENABLED) {
>               rtc->reg[r] = aspeed_rtc_get_counter(rtc, r);
>           }
> -        /* fall through */
> +        fallthrough;
>       case CONTROL:
>           val = rtc->reg[r];
>           break;
> @@ -106,7 +106,7 @@ static void aspeed_rtc_write(void *opaque, hwaddr addr,
>           if (!(rtc->reg[CONTROL] & RTC_UNLOCKED)) {
>               break;
>           }
> -        /* fall through */
> +        fallthrough;
>       case CONTROL:
>           rtc->reg[r] = val;
>           aspeed_rtc_calc_offset(rtc);
> diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
> index c27c362db9..6b6eef94fd 100644
> --- a/hw/rtc/mc146818rtc.c
> +++ b/hw/rtc/mc146818rtc.c
> @@ -457,7 +457,7 @@ static void cmos_ioport_write(void *opaque, hwaddr addr,
>               break;
>           case RTC_IBM_PS2_CENTURY_BYTE:
>               s->cmos_index = RTC_CENTURY;
> -            /* fall through */
> +            fallthrough;
>           case RTC_CENTURY:
>           case RTC_SECONDS:
>           case RTC_MINUTES:
> @@ -686,7 +686,7 @@ static uint64_t cmos_ioport_read(void *opaque, hwaddr addr,
>           switch(s->cmos_index) {
>           case RTC_IBM_PS2_CENTURY_BYTE:
>               s->cmos_index = RTC_CENTURY;
> -            /* fall through */
> +            fallthrough;
>           case RTC_CENTURY:
>           case RTC_SECONDS:
>           case RTC_MINUTES:
diff mbox series

Patch

diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
index fa861e2d49..59c64b01b9 100644
--- a/hw/rtc/aspeed_rtc.c
+++ b/hw/rtc/aspeed_rtc.c
@@ -78,7 +78,7 @@  static uint64_t aspeed_rtc_read(void *opaque, hwaddr addr,
         if (rtc->reg[CONTROL] & RTC_ENABLED) {
             rtc->reg[r] = aspeed_rtc_get_counter(rtc, r);
         }
-        /* fall through */
+        fallthrough;
     case CONTROL:
         val = rtc->reg[r];
         break;
@@ -106,7 +106,7 @@  static void aspeed_rtc_write(void *opaque, hwaddr addr,
         if (!(rtc->reg[CONTROL] & RTC_UNLOCKED)) {
             break;
         }
-        /* fall through */
+        fallthrough;
     case CONTROL:
         rtc->reg[r] = val;
         aspeed_rtc_calc_offset(rtc);
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index c27c362db9..6b6eef94fd 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -457,7 +457,7 @@  static void cmos_ioport_write(void *opaque, hwaddr addr,
             break;
         case RTC_IBM_PS2_CENTURY_BYTE:
             s->cmos_index = RTC_CENTURY;
-            /* fall through */
+            fallthrough;
         case RTC_CENTURY:
         case RTC_SECONDS:
         case RTC_MINUTES:
@@ -686,7 +686,7 @@  static uint64_t cmos_ioport_read(void *opaque, hwaddr addr,
         switch(s->cmos_index) {
         case RTC_IBM_PS2_CENTURY_BYTE:
             s->cmos_index = RTC_CENTURY;
-            /* fall through */
+            fallthrough;
         case RTC_CENTURY:
         case RTC_SECONDS:
         case RTC_MINUTES: