mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Simplify and build-fix (for some gcc versions) radix_tree_int_to_ptr().
Signed-off-by: Keir Fraser <keir@xen.org>
This commit is contained in:
1 parent
aef3f22758
commit
b004883e29
1 file changed
+3
-2
@@ -181,8 +181,9 @@ static inline void radix_tree_replace_slot(void **pslot, void *item)
|
||||
*/
|
||||
static inline void *radix_tree_int_to_ptr(int val)
|
||||
{
|
||||
ASSERT((val <= (LONG_MAX >> 2)) && (val >= (LONG_MIN >> 2)));
|
||||
return (void *)(((long)val << 2) | 0x2ul);
|
||||
long _ptr = ((long)val << 2) | 0x2l;
|
||||
ASSERT((_ptr >> 2) == val);
|
||||
return (void *)_ptr;
|
||||
}
|
||||
|
||||
static inline int radix_tree_ptr_to_int(void *ptr)
|
||||
|
||||