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

[Xen-changelog] [xen-unstable] Add parentheses to trace_do_casts macro.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Date 1174296772 0
# Node ID b795b90e4ff6ad9ce0c9fc47d921f91a4fb12cc5
# Parent  548e61fbdc1a0a04d2e494f2ef36b71201c18b4b
Add parentheses to trace_do_casts macro.

The arguments to this macro didn't have parentheses around them where
they were used.  If a call to a TRACE macro included an expression as
an argument, the cast to (unsigned long) could bind to just part of
the expression and lead to unexpected results.

Signed-off-by: Michael Vrable <mvrable@xxxxxxxxxxx>
---
 xen/include/xen/trace.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff -r 548e61fbdc1a -r b795b90e4ff6 xen/include/xen/trace.h
--- a/xen/include/xen/trace.h   Mon Mar 19 09:31:04 2007 +0000
+++ b/xen/include/xen/trace.h   Mon Mar 19 09:32:52 2007 +0000
@@ -41,11 +41,11 @@ void trace(u32 event, unsigned long d1, 
     do {                                 \
         if ( unlikely(tb_init_done) )    \
             trace(e,                     \
-                 (unsigned long)d1,      \
-                 (unsigned long)d2,      \
-                 (unsigned long)d3,      \
-                 (unsigned long)d4,      \
-                 (unsigned long)d5);     \
+                  (unsigned long)(d1),   \
+                  (unsigned long)(d2),   \
+                  (unsigned long)(d3),   \
+                  (unsigned long)(d4),   \
+                  (unsigned long)(d5));  \
     } while ( 0 )
 
 /* Convenience macros for calling the trace function. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.