RE: [PATCH 02/27] ia64/xen: introduce synch bitops which is necessary for ia64/xen support.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux