From: Amit Shah <amit.shah@redhat.com>
To: Ladi Prosek <lprosek@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, pagupta@redhat.com
Subject: Re: [Qemu-devel] [PATCH] rng: switch request queue to QSIMPLEQ
Date: Fri, 4 Mar 2016 11:57:23 +0530 [thread overview]
Message-ID: <20160304062723.GH15443@grmbl.mre> (raw)
In-Reply-To: <1457010971-24771-1-git-send-email-lprosek@redhat.com>
On (Thu) 03 Mar 2016 [14:16:11], Ladi Prosek wrote:
> QSIMPLEQ supports appending to tail in O(1) and is intrusive so
> it doesn't require extra memory allocations for the bookkeeping
> data.
>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
> @@ -83,24 +83,27 @@ static void rng_backend_free_request(RngRequest *req)
>
> static void rng_backend_free_requests(RngBackend *s)
> {
> - GSList *i;
> + RngRequest *req, *next;
>
> - for (i = s->requests; i; i = i->next) {
> - rng_backend_free_request(i->data);
> + QSIMPLEQ_FOREACH_SAFE(req, &s->requests, next, next) {
> + rng_backend_free_request(req);
> }
>
> - g_slist_free(s->requests);
> - s->requests = NULL;
> + QSIMPLEQ_INIT(&s->requests);
> }
This init here isn't necessary, the accessors for the queue will take
care of this.
Amit
next prev parent reply other threads:[~2016-03-04 6:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 13:16 [Qemu-devel] [PATCH] rng: switch request queue to QSIMPLEQ Ladi Prosek
2016-03-03 13:34 ` Paolo Bonzini
2016-03-04 6:27 ` Amit Shah [this message]
2016-03-04 8:04 ` Ladi Prosek
2016-03-04 9:12 ` Paolo Bonzini
2016-03-04 9:19 ` Ladi Prosek
2016-03-04 9:27 ` Paolo Bonzini
2016-03-04 9:46 ` Amit Shah
2016-03-04 9:16 ` Amit Shah
2016-03-04 9:46 ` Amit Shah
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=20160304062723.GH15443@grmbl.mre \
--to=amit.shah@redhat.com \
--cc=lprosek@redhat.com \
--cc=pagupta@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).