All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: aliguori@us.ibm.com, quintela@redhat.com,
	qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [RESEND PATCH 1/3] socket: remove redundant check
Date: Wed, 01 Aug 2012 13:50:54 +0200	[thread overview]
Message-ID: <874nomespt.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <CAFEAcA9_ATmjm95ottBKtpbaB5uEzOS2KNk19v6_vyngR8ZUKA@mail.gmail.com> (Peter Maydell's message of "Wed, 1 Aug 2012 12:23:02 +0100")

Peter Maydell <peter.maydell@linaro.org> writes:

> On 1 August 2012 11:50, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>> This isn't obvious.  It looks like the intent of the if (!e->ai_next) is
>> to suppress the error so that the next iteration of the *outer* loop can
>> succeed.
>
> Yeah, we only call it an error on the last time round. This
> loop is a bit confusingly structured, since we're effectively
> handling the failure in several places at once: we always
> fprintf() something, then we set the error on the last time
> round the loop, then at the end of the loop we fprintf again.
> We also duplicate the loop termination condition.

I cleaned it up some back in February, but my admittedly incremental
improvement was rejected because it didn't also convert to error_set().
*shrug*

http://lists.nongnu.org/archive/html/qemu-devel/2012-02/msg00772.html

[...]


WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: aliguori@us.ibm.com, quintela@redhat.com,
	qemu-trivial@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, Amos Kong <akong@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-trivial] [RESEND PATCH 1/3] socket: remove redundant check
Date: Wed, 01 Aug 2012 13:50:54 +0200	[thread overview]
Message-ID: <874nomespt.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <CAFEAcA9_ATmjm95ottBKtpbaB5uEzOS2KNk19v6_vyngR8ZUKA@mail.gmail.com> (Peter Maydell's message of "Wed, 1 Aug 2012 12:23:02 +0100")

Peter Maydell <peter.maydell@linaro.org> writes:

> On 1 August 2012 11:50, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>> This isn't obvious.  It looks like the intent of the if (!e->ai_next) is
>> to suppress the error so that the next iteration of the *outer* loop can
>> succeed.
>
> Yeah, we only call it an error on the last time round. This
> loop is a bit confusingly structured, since we're effectively
> handling the failure in several places at once: we always
> fprintf() something, then we set the error on the last time
> round the loop, then at the end of the loop we fprintf again.
> We also duplicate the loop termination condition.

I cleaned it up some back in February, but my admittedly incremental
improvement was rejected because it didn't also convert to error_set().
*shrug*

http://lists.nongnu.org/archive/html/qemu-devel/2012-02/msg00772.html

[...]

  reply	other threads:[~2012-08-01 11:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17 15:45 [Qemu-devel] [PATCH 0/2] trivial fix of qemu-sockets.c Amos Kong
2012-07-17 15:45 ` [Qemu-devel] [PATCH 1/2] socket: remove redundant check Amos Kong
2012-07-17 15:45 ` [Qemu-devel] [PATCH 2/2] remove unused include of error.h Amos Kong
2012-08-01  8:59 ` [Qemu-trivial] [RESEND PATCH 0/3] trivial fix of qemu-sockets.c Amos Kong
2012-08-01  8:59   ` [Qemu-devel] " Amos Kong
2012-08-01  8:59 ` [Qemu-trivial] [RESEND PATCH 1/3] socket: remove redundant check Amos Kong
2012-08-01  8:59   ` [Qemu-devel] " Amos Kong
2012-08-01 10:50   ` [Qemu-trivial] " Stefan Hajnoczi
2012-08-01 10:50     ` [Qemu-devel] " Stefan Hajnoczi
2012-08-01 11:23     ` [Qemu-trivial] [Qemu-devel] " Peter Maydell
2012-08-01 11:23       ` [Qemu-devel] [Qemu-trivial] " Peter Maydell
2012-08-01 11:50       ` Markus Armbruster [this message]
2012-08-01 11:50         ` Markus Armbruster
2012-08-01 11:48     ` [Qemu-trivial] [Qemu-devel] " Markus Armbruster
2012-08-01 11:48       ` [Qemu-devel] [Qemu-trivial] " Markus Armbruster
2012-08-03  2:59       ` [Qemu-trivial] [Qemu-devel] " Amos Kong
2012-08-03  2:59         ` [Qemu-devel] [Qemu-trivial] " Amos Kong
2012-08-01  8:59 ` [Qemu-trivial] [RESEND PATCH 2/3] remove unused include of error.h Amos Kong
2012-08-01  8:59   ` [Qemu-devel] " Amos Kong
2012-08-01  8:59 ` [Qemu-trivial] [RESEND PATCH 3/3] socket: clean up redundant assignment Amos Kong
2012-08-01  8:59   ` [Qemu-devel] " Amos Kong

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=874nomespt.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=quintela@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.