Patchwork [PULL,19/26] ide-test: Add enum value for DEV

login
register
mail settings
Submitter Stefan Hajnoczi
Date June 7, 2013, 11:58 a.m.
Message ID <1370606325-10680-20-git-send-email-stefanha@redhat.com>
Download mbox | patch
Permalink /patch/249697/
State New
Headers show

Comments

Stefan Hajnoczi - June 7, 2013, 11:58 a.m.
From: Kevin Wolf <kwolf@redhat.com>

Get rid of the magic number.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/ide-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/tests/ide-test.c b/tests/ide-test.c
index 365e995..1c31a2e 100644
--- a/tests/ide-test.c
+++ b/tests/ide-test.c
@@ -64,6 +64,7 @@  enum {
 };
 
 enum {
+    DEV     = 0x10,
     LBA     = 0x40,
 };
 
@@ -394,7 +395,7 @@  static void test_identify(void)
 
     /* Read in the IDENTIFY buffer and check registers */
     data = inb(IDE_BASE + reg_device);
-    g_assert_cmpint(data & 0x10, ==, 0);
+    g_assert_cmpint(data & DEV, ==, 0);
 
     for (i = 0; i < 256; i++) {
         data = inb(IDE_BASE + reg_status);