qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Markus Armbruster <armbru@redhat.com>,
	Mark Langsdorf <mark.langsdorf@calxeda.com>,
	Stefan Weil <sw@weilnetz.de>, Riku Voipio <riku.voipio@iki.fi>,
	qemu-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>,
	Peter Crosthwaite <peter.crosthwaite@petalogix.com>,
	Max Filippov <jcmvbkbc@gmail.com>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	Paul Brook <paul@codesourcery.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Vassili Karpov (malc)" <av1474@comtv.ru>,
	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: Sun, 20 Jan 2013 18:38:02 +0100	[thread overview]
Message-ID: <50FC2B7A.208@suse.de> (raw)
In-Reply-To: <CAAu8pHuEe0gMErS+F1cQbK2CVV30r1UVUPfmLM929N3NFBVBnA@mail.gmail.com>

Am 20.01.2013 18:26, schrieb Blue Swirl:
> On Sun, Jan 20, 2013 at 4:56 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 20 January 2013 15:54, Blue Swirl <blauwirbel@gmail.com> wrote:
>>
>> This patch is a bit big to usefully review. A few comments on bits
>> I happened to notice:
[...]
>>> --- a/hw/stellaris.c
>>> +++ b/hw/stellaris.c
>>> @@ -182,8 +182,10 @@ static uint64_t gptm_read(void *opaque, hwaddr offset,
>>>      case 0x48: /* TAR */
>>>          if (s->control == 1)
>>>              return s->rtc;
>>> +        /* XXX: questionable fallthrough */
>>>      case 0x4c: /* TBR */
>>>          hw_error("TODO: Timer value read\n");
>>> +        /* XXX: questionable fallthrough */
>>
>> This isn't a fallthrough at all, hw_error() never returns.

Maybe hw_error() needs some annotation instead?

>> I don't think there's much point adding tons of "XXX" comments
>> when a bunch of these aren't actually wrong code. If you want to fix
>> this I think a better approach would be more focused patches aimed
>> at adding 'break;' or "/* fallthrough */" based on actual human
>> examination of the surrounding code.

+1

> The problem is that while some cases may be easy to decide, others are
> not so clear.
> 
> My initial thought about the work flow was that this patch should be
> succeeded by other patches which replace the comment with correct
> action. These could be squashed to the original patch or committed
> later. If no decision can be made for some comment, it could stay as
> XXX.

$ git grep XXX | wc --lines
75797

I don't think adding any more will help getting them addressed...

> Alternatively, I could split this patch per maintainer, architecture
> or file even. Each maintainer could tune the patches as they see fit
> and commit whatever they want later. Probably some areas would be
> never fixed.

I would suggest to split per file and to propose either action rather
than putting an XXX. I'm sure there would be static analysis volunteers
to help review, CC'ing Stefan W. and Markus. :)

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2013-01-20 17:38 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 [this message]
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
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=50FC2B7A.208@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=av1474@comtv.ru \
    --cc=blauwirbel@gmail.com \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=jcmvbkbc@gmail.com \
    --cc=kwolf@redhat.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 \
    --cc=sw@weilnetz.de \
    /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).