]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
x86: desc_empty
authorRoland McGrath <roland@redhat.com>
Wed, 30 Jan 2008 12:30:45 +0000 (13:30 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Jan 2008 12:30:45 +0000 (13:30 +0100)
This replaces the desc_empty macro with an inline.  It now handles
easily any of the four different types used between 32/64 code to
refer to these 8 bytes.  It's identical in both asm-x86/processor_64.h
and asm-x86/processor_32.h, so if these files ever get merged this
function can be in the common code.

This also removes the desc_equal macro because nothing uses it.

Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/asm-x86/processor_32.h
include/asm-x86/processor_64.h

index 3b51a18f16d5d57fecbb5e19905da4d9e246265c..2540bf8d57240cd5c5c379e8b13161b9a9a98c92 100644 (file)
@@ -28,11 +28,12 @@ struct desc_struct {
        unsigned long a,b;
 };
 
-#define desc_empty(desc) \
-               (!((desc)->a | (desc)->b))
+static inline int desc_empty(const void *ptr)
+{
+       const u32 *desc = ptr;
+       return !(desc[0] | desc[1]);
+}
 
-#define desc_equal(desc1, desc2) \
-               (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
 /*
  * Default implementation of macro that returns current
  * instruction pointer ("program counter").
index 2ae8ceb8a74ed6ec3ee8ce9eedce2ee4c111e32d..20d8935d141ac4217d59b1ab6a013d6159d0b973 100644 (file)
 #define VIP_MASK       0x00100000      /* virtual interrupt pending */
 #define ID_MASK                0x00200000
 
-#define desc_empty(desc) \
-               (!((desc)->a | (desc)->b))
-
-#define desc_equal(desc1, desc2) \
-               (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
+static inline int desc_empty(const void *ptr)
+{
+       const u32 *desc = ptr;
+       return !(desc[0] | desc[1]);
+}
 
 /*
  * Default implementation of macro that returns current