[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 2/2] xen/arm: asm/atomic.h: Fix MISRA C 2012 Rule 2.5 violation
Hi Julien, On 7/27/22 18:46, Julien Grall wrote: Hi Xenia, On 27/07/2022 16:32, Xenia Ragiadakou wrote:Remove unused macro atomic_xchg(). Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx> --- xen/arch/arm/include/asm/atomic.h | 2 -- 1 file changed, 2 deletions(-)diff --git a/xen/arch/arm/include/asm/atomic.h b/xen/arch/arm/include/asm/atomic.hindex f5ef744b4b..a2dc125291 100644 --- a/xen/arch/arm/include/asm/atomic.h +++ b/xen/arch/arm/include/asm/atomic.h@@ -223,8 +223,6 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)return __atomic_add_unless(v, a, u); } -#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) -While I agree this is unused today, the wrapper is quite trivial and part of the generic API (x86 also provides one). So I am not in favor of removing it just to please MISRA. That's fine, the rule 2.5 is advisory. I sent the patch because I noticed that the macro was unused, just in case ... That said, if Bertrand and Stefano agrees with removing it then you should also remove the x86 version to avoid inconsistency.Cheers, -- Xenia
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |