xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: qemu-devel@nongnu.org
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>
Subject: [PATCH 2/2] xenfb: remove out_cons in xenfb_handle_events
Date: Tue, 12 Apr 2016 10:57:17 +0100	[thread overview]
Message-ID: <1460455037-28213-3-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1460455037-28213-1-git-send-email-wei.liu2@citrix.com>

The variable out_cons was only used to temporarily hold the consumer
index. Use cons directly to simplify code a bit.

No functional change introduced.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
---
 hw/display/xenfb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 9866dfd..78a8dcd 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -770,16 +770,16 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons, out_cons;
+    uint32_t prod, cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    out_cons = page->out_cons;
-    if (prod - out_cons > XENFB_OUT_RING_LEN) {
+    cons = page->out_cons;
+    if (prod - cons > XENFB_OUT_RING_LEN) {
         return;
     }
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = out_cons; cons != prod; cons++) {
+    for ( ; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
         uint8_t type = event->type;
 	int x, y, w, h;
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-04-12  9:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1460455037-28213-1-git-send-email-wei.liu2@citrix.com>
2016-04-12  9:57 ` [PATCH 1/2] xenfb: use the correct condition to avoid excessive looping Wei Liu
2016-04-12  9:57 ` Wei Liu [this message]
2016-04-12  9:59   ` [PATCH 2/2] xenfb: remove out_cons in xenfb_handle_events Andrew Cooper
2016-04-12 10:04     ` Wei Liu
     [not found] ` <1460455037-28213-2-git-send-email-wei.liu2@citrix.com>
2016-04-12 10:04   ` [PATCH 1/2] xenfb: use the correct condition to avoid excessive looping Anthony PERARD

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=1460455037-28213-3-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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).