[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XEN PATCH 05/10] xen/spinlock: address violations of MISRA C Rule 20.7
MISRA C Rule 20.7 states: "Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses". Therefore, some macro definitions should gain additional parentheses to ensure that all current and future users will be safe with respect to expansions that can possibly alter the semantics of the passed-in macro parameter. No functional change. Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx> --- xen/common/spinlock.c | 2 +- xen/include/xen/spinlock.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 5aa9ba618859..558ea7ac3518 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -269,7 +269,7 @@ void spin_debug_disable(void) profile->lock_cnt++; \ } #define LOCK_PROFILE_VAR(var, val) s_time_t var = (val) -#define LOCK_PROFILE_BLOCK(var) var = var ? : NOW() +#define LOCK_PROFILE_BLOCK(var) (var) = (var) ? : NOW() #define LOCK_PROFILE_BLKACC(tst, val) \ if ( tst ) \ { \ diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h index 18793c5e29cb..8825affb25ca 100644 --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -141,7 +141,7 @@ struct lock_profile_qhead { } \ prof->name = #l; \ prof->ptr.lockptr = &(s)->l; \ - prof->is_rlock = isr; \ + prof->is_rlock = (isr); \ prof->next = (s)->profile_head.elem_q; \ (s)->profile_head.elem_q = prof; \ } while( 0 ) -- 2.34.1
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |