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-devel

[Xen-devel] [PATCH] Add parentheses to trace_do_casts macro

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Add parentheses to trace_do_casts macro
From: Michael Vrable <mvrable@xxxxxxxxxxx>
Date: Sat, 17 Mar 2007 13:54:15 -0700
Delivery-date: Sat, 17 Mar 2007 13:53:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
# HG changeset patch
# User Michael Vrable <mvrable@xxxxxxxxxxx>
# Date 1174163889 25200
# Node ID e3b3abd0ee933833e4a20a048de35954675a4ad1
# Parent  98eacf1b075cc8bb2ed9136a0ca381840b8d7ae2
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>

diff -r 98eacf1b075c -r e3b3abd0ee93 xen/include/xen/trace.h
--- a/xen/include/xen/trace.h   Sat Mar 17 12:24:32 2007 +0000
+++ b/xen/include/xen/trace.h   Sat Mar 17 13:38:09 2007 -0700
@@ -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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

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