public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: kvm@vger.kernel.org
Cc: Pekka Enberg <penberg@kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH 2/3] kmv tools, i8042: Use kernel status register bit names
Date: Thu,  2 Jun 2011 13:56:41 +0300	[thread overview]
Message-ID: <1307012202-14875-2-git-send-email-penberg@kernel.org> (raw)
In-Reply-To: <1307012202-14875-1-git-send-email-penberg@kernel.org>

This patch renames the status register bit constant names to be identical with
drivers/input/serio/i8042.h. This makes code review easier.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
---
 tools/kvm/hw/i8042.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/kvm/hw/i8042.c b/tools/kvm/hw/i8042.c
index d3f5d9a..48a3c9d 100644
--- a/tools/kvm/hw/i8042.c
+++ b/tools/kvm/hw/i8042.c
@@ -42,11 +42,11 @@
 /*
  * Status register bits
  */
-#define KBD_STATUS_AUX_OBF	0x20
-#define KBD_STATUS_INH		0x10
-#define KBD_STATUS_A2		0x08
-#define KBD_STATUS_SYS		0x04
-#define KBD_STATUS_OBF		0x01
+#define I8042_STR_AUXDATA	0x20
+#define I8042_STR_KEYLOCK	0x10
+#define I8042_STR_CMDDAT	0x08
+#define I8042_STR_MUXERR	0x04
+#define I8042_STR_OBF		0x01
 
 #define KBD_MODE_KBD_INT	0x01
 #define KBD_MODE_SYS		0x02
@@ -92,16 +92,16 @@ static void kbd_update_irq(void)
 	u8 mlevel = 0;
 
 	/* First, clear the kbd and aux output buffer full bits */
-	state.status &= ~(KBD_STATUS_OBF | KBD_STATUS_AUX_OBF);
+	state.status &= ~(I8042_STR_OBF | I8042_STR_AUXDATA);
 
 	if (state.kcount > 0) {
-		state.status |= KBD_STATUS_OBF;
+		state.status |= I8042_STR_OBF;
 		klevel = 1;
 	}
 
 	/* Keyboard has higher priority than mouse */
 	if (klevel == 0 && state.mcount != 0) {
-		state.status |= KBD_STATUS_OBF | KBD_STATUS_AUX_OBF;
+		state.status |= I8042_STR_OBF | I8042_STR_AUXDATA;
 		mlevel = 1;
 	}
 
@@ -281,7 +281,7 @@ static void kbd_write_data(u32 val)
 static void kbd_reset(void)
 {
 	state = (struct kbd_state) {
-		.status		= KBD_STATUS_SYS | KBD_STATUS_A2 | KBD_STATUS_INH, /* 0x1c */
+		.status		= I8042_STR_MUXERR | I8042_STR_CMDDAT | I8042_STR_KEYLOCK, /* 0x1c */
 		.mode		= KBD_MODE_KBD_INT | KBD_MODE_SYS, /* 0x3 */
 		.mres		= AUX_DEFAULT_RESOLUTION,
 		.msample	= AUX_DEFAULT_SAMPLE,
-- 
1.7.0.4


  reply	other threads:[~2011-06-02 10:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-02 10:56 [PATCH 1/3] kvm tools, i8042: Sort status register bits Pekka Enberg
2011-06-02 10:56 ` Pekka Enberg [this message]
2011-06-02 10:56 ` [PATCH 3/3] kvm tools, i8042: Use kernel command names Pekka Enberg
2011-06-02 11:04   ` Ingo Molnar
2011-06-02 11:19   ` Ingo Molnar
2011-06-02 11:22     ` Pekka Enberg
2011-06-02 12:12     ` Ingo Molnar

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=1307012202-14875-2-git-send-email-penberg@kernel.org \
    --to=penberg@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=mingo@elte.hu \
    /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