From: Michael Vrable <mvrable@cs.ucsd.edu>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Add parentheses to trace_do_casts macro
Date: Sat, 17 Mar 2007 13:54:15 -0700 [thread overview]
Message-ID: <20070317205414.GA813@vrable.net> (raw)
# HG changeset patch
# User Michael Vrable <mvrable@cs.ucsd.edu>
# 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@cs.ucsd.edu>
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. */
next reply other threads:[~2007-03-17 20:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-17 20:54 Michael Vrable [this message]
2007-03-17 23:41 ` [PATCH] Add parentheses to trace_do_casts macro Mark Williamson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070317205414.GA813@vrable.net \
--to=mvrable@cs.ucsd.edu \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.