All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
To: Alberto Garcia <berto@igalia.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: remove redundant check before g_slist_find()
Date: Mon, 29 Jun 2015 16:32:49 +0300	[thread overview]
Message-ID: <87bnfyd4hq.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1435583533-5758-1-git-send-email-berto@igalia.com> (Alberto Garcia's message of "Mon, 29 Jun 2015 16:12:13 +0300")

Alberto Garcia <berto@igalia.com> writes:

> An empty GSList is represented by a NULL pointer, therefore it's a
> perfectly valid argument for g_slist_find() and there's no need to
> make any additional check.
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  block/io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/io.c b/block/io.c
> index e295992..2f7f889 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -283,7 +283,7 @@ void bdrv_drain_all(void)
>          }
>          aio_context_release(aio_context);
>
> -        if (!aio_ctxs || !g_slist_find(aio_ctxs, aio_context)) {
> +        if (!g_slist_find(aio_ctxs, aio_context)) {
>              aio_ctxs = g_slist_prepend(aio_ctxs, aio_context);
>          }
>      }

Seems ok to me.

  reply	other threads:[~2015-06-29 13:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-29 13:12 [Qemu-devel] [PATCH] block: remove redundant check before g_slist_find() Alberto Garcia
2015-06-29 13:32 ` Alexander Yarygin [this message]
2015-06-30 12:54 ` Stefan Hajnoczi

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=87bnfyd4hq.fsf@linux.vnet.ibm.com \
    --to=yarygin@linux.vnet.ibm.com \
    --cc=berto@igalia.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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.