WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] RE: [PATCH 02/27] ia64/xen: introduce synch bitops whic

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>, "linux-ia64@xxxxxxxxxxxxxxx" <linux-ia64@xxxxxxxxxxxxxxx>
Subject: [Xen-ia64-devel] RE: [PATCH 02/27] ia64/xen: introduce synch bitops which is necessary for ia64/xen support.
From: "Luck, Tony" <tony.luck@xxxxxxxxx>
Date: Tue, 17 Jun 2008 16:24:10 -0700
Accept-language: en-US
Acceptlanguage: en-US
Cc: Fitzhardinge <jeremy@xxxxxxxx>, Jeremy, "virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx" <virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx>, Robin Holt <holt@xxxxxxx>, "xen-ia64-devel@xxxxxxxxxxxxxxxxxxx" <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 17 Jun 2008 16:24:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1213084043534-git-send-email-yamahata@xxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <12130840433561-git-send-email-yamahata@xxxxxxxxxxxxx> <1213084043534-git-send-email-yamahata@xxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjKzpWBHbyWmYx/T1uL6W7F+ID/FwGAQljQ
Thread-topic: [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

<Prev in Thread] Current Thread [Next in Thread>