From: Laurent Vivier <laurent@vivier.eu>
To: Chen Qun <kuhn.chenqun@huawei.com>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>,
zhang.zhanghailiang@huawei.com, ganqixin@huawei.com,
Euler Robot <euler.robot@huawei.com>
Subject: Re: [PATCH v2 4/8] linux-user/mips/cpu_loop: silence the compiler warnings
Date: Fri, 30 Oct 2020 10:55:17 +0100 [thread overview]
Message-ID: <b3a0569a-d4a9-d73f-8c20-6e8c6251dace@vivier.eu> (raw)
In-Reply-To: <20201030004046.2191790-5-kuhn.chenqun@huawei.com>
Le 30/10/2020 à 01:40, Chen Qun a écrit :
> When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warning:
> linux-user/mips/cpu_loop.c: In function ‘cpu_loop’:
> linux-user/mips/cpu_loop.c:104:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
> 104 | if ((ret = get_user_ual(arg8, sp_reg + 28)) != 0) {
> | ^
> linux-user/mips/cpu_loop.c:107:17: note: here
> 107 | case 7:
> | ^~~~
> linux-user/mips/cpu_loop.c:108:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
> 108 | if ((ret = get_user_ual(arg7, sp_reg + 24)) != 0) {
> | ^
> linux-user/mips/cpu_loop.c:111:17: note: here
> 111 | case 6:
> | ^~~~
> linux-user/mips/cpu_loop.c:112:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
> 112 | if ((ret = get_user_ual(arg6, sp_reg + 20)) != 0) {
> | ^
> linux-user/mips/cpu_loop.c:115:17: note: here
> 115 | case 5:
> | ^~~~
>
> Add the corresponding "fall through" comment to fix it.
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
> Cc: Laurent Vivier <laurent@vivier.eu>
> ---
> linux-user/mips/cpu_loop.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c
> index 553e8ca7f5..cfe7ba5c47 100644
> --- a/linux-user/mips/cpu_loop.c
> +++ b/linux-user/mips/cpu_loop.c
> @@ -104,18 +104,22 @@ void cpu_loop(CPUMIPSState *env)
> if ((ret = get_user_ual(arg8, sp_reg + 28)) != 0) {
> goto done_syscall;
> }
> + /* fall through */
> case 7:
> if ((ret = get_user_ual(arg7, sp_reg + 24)) != 0) {
> goto done_syscall;
> }
> + /* fall through */
> case 6:
> if ((ret = get_user_ual(arg6, sp_reg + 20)) != 0) {
> goto done_syscall;
> }
> + /* fall through */
> case 5:
> if ((ret = get_user_ual(arg5, sp_reg + 16)) != 0) {
> goto done_syscall;
> }
> + /* fall through */
> default:
> break;
> }
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
next prev parent reply other threads:[~2020-10-30 9:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 0:40 [PATCH v2 0/8] silence the compiler warnings Chen Qun
2020-10-30 0:40 ` [PATCH v2 1/8] target/i386: silence the compiler warnings in gen_shiftd_rm_T1 Chen Qun
2020-10-30 0:40 ` [PATCH v2 2/8] hw/intc/arm_gicv3_kvm: silence the compiler warnings Chen Qun
2020-10-30 0:40 ` [PATCH v2 3/8] accel/tcg/user-exec: " Chen Qun
2020-10-30 5:50 ` Richard Henderson
2020-10-30 6:31 ` Philippe Mathieu-Daudé
2020-10-30 15:40 ` Thomas Huth
2020-10-30 0:40 ` [PATCH v2 4/8] linux-user/mips/cpu_loop: " Chen Qun
2020-10-30 9:55 ` Laurent Vivier [this message]
2020-11-04 21:22 ` Laurent Vivier
2020-10-30 0:40 ` [PATCH v2 5/8] target/sparc/translate: " Chen Qun
2020-10-30 0:40 ` [PATCH v2 6/8] target/sparc/win_helper: " Chen Qun
2020-10-30 5:52 ` Richard Henderson
2020-10-30 6:32 ` Philippe Mathieu-Daudé
2020-10-30 0:40 ` [PATCH v2 7/8] ppc: Add a missing break for PPC6xx_INPUT_TBEN Chen Qun
2020-10-30 15:41 ` Thomas Huth
2020-10-31 5:01 ` David Gibson
2020-10-30 0:40 ` [PATCH v2 8/8] target/ppc: replaced the TODO with LOG_UNIMP and add break for silence warnings Chen Qun
2020-10-30 6:33 ` Philippe Mathieu-Daudé
2020-10-30 15:43 ` Thomas Huth
2020-10-31 5:01 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b3a0569a-d4a9-d73f-8c20-6e8c6251dace@vivier.eu \
--to=laurent@vivier.eu \
--cc=euler.robot@huawei.com \
--cc=ganqixin@huawei.com \
--cc=kuhn.chenqun@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=thuth@redhat.com \
--cc=zhang.zhanghailiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).