Skip to content

Commit

Permalink
hw/net/imx_fec: Rewrite fall through comments
Browse files Browse the repository at this point in the history
GCC9 is confused by this comment when building with CFLAG
-Wimplicit-fallthrough=2:

  hw/net/imx_fec.c: In function ‘imx_eth_write’:
  hw/net/imx_fec.c:906:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
    906 |         if (unlikely(single_tx_ring)) {
        |            ^
  hw/net/imx_fec.c:912:5: note: here
    912 |     case ENET_TDAR:     /* FALLTHROUGH */
        |     ^~~~
  cc1: all warnings being treated as errors

Rewrite the comments in the correct place,  using 'fall through'
which is recognized by GCC and static analyzers.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20191218192526.13845-5-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
philmd authored and bonzini committed Jan 24, 2020
1 parent f70fe18 commit 174c556
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hw/net/imx_fec.c
Expand Up @@ -909,7 +909,8 @@ static void imx_eth_write(void *opaque, hwaddr offset, uint64_t value,
TYPE_IMX_FEC, __func__);
return;
}
case ENET_TDAR: /* FALLTHROUGH */
/* fall through */
case ENET_TDAR:
if (s->regs[ENET_ECR] & ENET_ECR_ETHEREN) {
s->regs[index] = ENET_TDAR_TDAR;
imx_eth_do_tx(s, index);
Expand Down

0 comments on commit 174c556

Please sign in to comment.