diff mbox series

[RFC,v3,09/78] hw/acpi/aml-build.c: add fallthrough pseudo-keyword

Message ID 4e765b488f59391b94da71a7cbaaebedc3a0a18f.1697186560.git.manos.pitsidianakis@linaro.org
State New
Headers show
Series Strict disable implicit fallthrough | expand

Commit Message

Manos Pitsidianakis Oct. 13, 2023, 8:45 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/acpi/aml-build.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Ani Sinha Oct. 17, 2023, 8:40 a.m. UTC | #1
> On 13-Oct-2023, at 2:15 PM, Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org> 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>

What was wrong with QEMU_FALLTHROUGH? 
https://www.mail-archive.com/qemu-devel@nongnu.org/msg996916.html does not explain and there is no commit message that justifies the change.

Other than that,

Reviewed-by: Ani Sinha <anisinha@redhat.com>


> ---
> hw/acpi/aml-build.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index af66bde0f5..b0cf0c6073 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -326,17 +326,16 @@ build_prepend_package_length(GArray *package, unsigned length, bool incl_self)
>         byte = length >> PACKAGE_LENGTH_4BYTE_SHIFT;
>         build_prepend_byte(package, byte);
>         length &= (1 << PACKAGE_LENGTH_4BYTE_SHIFT) - 1;
> -        /* fall through */
> +        fallthrough;
>     case 3:
>         byte = length >> PACKAGE_LENGTH_3BYTE_SHIFT;
>         build_prepend_byte(package, byte);
>         length &= (1 << PACKAGE_LENGTH_3BYTE_SHIFT) - 1;
> -        /* fall through */
> +        fallthrough;
>     case 2:
>         byte = length >> PACKAGE_LENGTH_2BYTE_SHIFT;
>         build_prepend_byte(package, byte);
>         length &= (1 << PACKAGE_LENGTH_2BYTE_SHIFT) - 1;
> -        /* fall through */
>     }
>     /*
>      * Most significant two bits of byte zero indicate how many following bytes
> @@ -528,6 +527,7 @@ void aml_append(Aml *parent_ctx, Aml *child)
>          */
>         build_append_byte(buf, 0);
>         /* fall through, to pack resources in buffer */
> +        fallthrough;
>     case AML_BUFFER:
>         build_buffer(buf, child->op);
>         break;
> -- 
> 2.39.2
>
diff mbox series

Patch

diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index af66bde0f5..b0cf0c6073 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -326,17 +326,16 @@  build_prepend_package_length(GArray *package, unsigned length, bool incl_self)
         byte = length >> PACKAGE_LENGTH_4BYTE_SHIFT;
         build_prepend_byte(package, byte);
         length &= (1 << PACKAGE_LENGTH_4BYTE_SHIFT) - 1;
-        /* fall through */
+        fallthrough;
     case 3:
         byte = length >> PACKAGE_LENGTH_3BYTE_SHIFT;
         build_prepend_byte(package, byte);
         length &= (1 << PACKAGE_LENGTH_3BYTE_SHIFT) - 1;
-        /* fall through */
+        fallthrough;
     case 2:
         byte = length >> PACKAGE_LENGTH_2BYTE_SHIFT;
         build_prepend_byte(package, byte);
         length &= (1 << PACKAGE_LENGTH_2BYTE_SHIFT) - 1;
-        /* fall through */
     }
     /*
      * Most significant two bits of byte zero indicate how many following bytes
@@ -528,6 +527,7 @@  void aml_append(Aml *parent_ctx, Aml *child)
          */
         build_append_byte(buf, 0);
         /* fall through, to pack resources in buffer */
+        fallthrough;
     case AML_BUFFER:
         build_buffer(buf, child->op);
         break;