From: Kevin Wolf <kwolf@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Anthony Liguori <aliguori@us.ibm.com>,
Mark Langsdorf <mark.langsdorf@calxeda.com>,
qemu-ppc@nongnu.org, Riku Voipio <riku.voipio@iki.fi>,
qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
Peter Crosthwaite <peter.crosthwaite@petalogix.com>,
Max Filippov <jcmvbkbc@gmail.com>,
"Vassili Karpov (malc)" <av1474@comtv.ru>,
Paul Brook <paul@codesourcery.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Guan Xuetao <gxt@mprc.pku.edu.cn>,
Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs
Date: Mon, 21 Jan 2013 09:58:21 +0100 [thread overview]
Message-ID: <50FD032D.7020601@redhat.com> (raw)
In-Reply-To: <19952e84d566d9309b15fe205db6b166f4234c33.1358697255.git.blauwirbel@gmail.com>
Am 20.01.2013 16:54, schrieb Blue Swirl:
> Recent Clang compilers have preliminary support for finding
> unannotated fallthrough cases in switch statements with
> compiler flag -Wimplicit-fallthrough. The support is incomplete,
> it's only possible to annotate the case in C++ but not in C, so it
> wouldn't be useful to enable the flag for QEMU yet.
>
> Mark cases which don't have a comment about fall through with
> a comment. In legitimate fall through cases the comment can be
> edited later to mark the case for future readers.
>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index 14ad079..0457c65 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -1151,6 +1151,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
> break;
> case WIN_VERIFY_EXT:
> lba48 = 1;
> + /* XXX: questionable fallthrough */
> case WIN_VERIFY:
> case WIN_VERIFY_ONCE:
> /* do sector number check ? */
> @@ -1160,6 +1161,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
> break;
> case WIN_READ_EXT:
> lba48 = 1;
> + /* XXX: questionable fallthrough */
> case WIN_READ:
> case WIN_READ_ONCE:
> if (s->drive_kind == IDE_CD) {
> @@ -1175,6 +1177,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
> break;
> case WIN_WRITE_EXT:
> lba48 = 1;
> + /* XXX: questionable fallthrough */
> case WIN_WRITE:
> case WIN_WRITE_ONCE:
> case CFA_WRITE_SECT_WO_ERASE:
> @@ -1191,6 +1194,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
> break;
> case WIN_MULTREAD_EXT:
> lba48 = 1;
> + /* XXX: questionable fallthrough */
> case WIN_MULTREAD:
> if (!s->bs) {
> goto abort_cmd;
> @@ -1204,6 +1208,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
> break;
> case WIN_MULTWRITE_EXT:
> lba48 = 1;
> + /* XXX: questionable fallthrough */
> case WIN_MULTWRITE:
> case CFA_WRITE_MULTI_WO_ERASE:
> if (!s->bs) {
> @@ -1224,6 +1229,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
> break;
> case WIN_READDMA_EXT:
> lba48 = 1;
> + /* XXX: questionable fallthrough */
> case WIN_READDMA:
> case WIN_READDMA_ONCE:
> if (!s->bs) {
> @@ -1234,6 +1240,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
> break;
> case WIN_WRITEDMA_EXT:
> lba48 = 1;
> + /* XXX: questionable fallthrough */
> case WIN_WRITEDMA:
> case WIN_WRITEDMA_ONCE:
> if (!s->bs) {
> @@ -1245,6 +1252,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
> break;
> case WIN_READ_NATIVE_MAX_EXT:
> lba48 = 1;
> + /* XXX: questionable fallthrough */
> case WIN_READ_NATIVE_MAX:
> ide_cmd_lba48_transform(s, lba48);
> ide_set_sector(s, s->nb_sectors - 1);
All IDE cases are clearly intentional.
Kevin
next prev parent reply other threads:[~2013-01-21 8:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-20 15:54 [Qemu-devel] [PATCH] Annotate questionable fallthroughs Blue Swirl
2013-01-20 16:56 ` Peter Maydell
2013-01-20 17:26 ` Blue Swirl
2013-01-20 17:38 ` Andreas Färber
2013-01-20 18:10 ` Peter Maydell
2013-01-20 18:32 ` Paul Brook
2013-01-21 10:36 ` Markus Armbruster
2013-01-21 8:58 ` Kevin Wolf [this message]
2013-01-21 13:11 ` Markus Armbruster
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=50FD032D.7020601@redhat.com \
--to=kwolf@redhat.com \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=aurelien@aurel32.net \
--cc=av1474@comtv.ru \
--cc=blauwirbel@gmail.com \
--cc=gxt@mprc.pku.edu.cn \
--cc=jcmvbkbc@gmail.com \
--cc=mark.langsdorf@calxeda.com \
--cc=paul@codesourcery.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@petalogix.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=rth@twiddle.net \
/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).