|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-ia64-devel] RE: [PATCH 02/27] ia64/xen: introduce synch bitops which is necessary for ia64/xen support.
Just started digging through these ... part 01/27 was fine. But here
are a couple of comments for part 02/27
+/*
+ * Copyright 1992, Linus Torvalds.
+ * Heavily modified to provide guaranteed strong synchronisation
+ * when communicating with Xen or other guest OSes running on other CPUs.
+ */
Presumably Linus didn't write this in 1992. Perhaps this file
contains enough new material to warrant your own copyright?
+static inline int sync_const_test_bit(int nr, const volatile void *addr)
+{
+ return test_bit(nr, addr);
+}
+
+static inline int sync_var_test_bit(int nr, volatile void *addr)
+{
+ return test_bit(nr, addr);
+}
...
+#define sync_test_bit(nr,addr) \
+ (__builtin_constant_p(nr) ? \
+ sync_const_test_bit((nr), (addr)) : \
+ sync_var_test_bit((nr), (addr)))
What use is this? It doesn't matter whether "nr" is constant or
not you still end up using "test_bit" ... so why make the compiler
do all the extra work when you just mean this?
static inline int sync_test_bit(int nr, volatile void *addr)
{
return test_bit(nr, addr);
}
-Tony
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |