From f087ec082647343dccfc321d6d0d3e779b9a8ee3 Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Mon, 11 Mar 2019 16:41:36 -0400 Subject: [PATCH] gpu: nvgpu: posix: fix cmpxchg MISRA 17.3 bug In the commit "gpu: nvgpu: unit: update misc atomics to use gcc builtins" the cmpxchg macro used by the "POSIX" build changed and introduced a MISRA 17.3 violation for a macro parameter that needed parentheses. This updates the macro to resolve this violation. Change-Id: I16927ecaa751964f8c397c95086c663a683f8241 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2070064 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Tejal Kudav Reviewed-by: Adeel Raza Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/posix/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/posix/atomic.h b/drivers/gpu/nvgpu/include/nvgpu/posix/atomic.h index ef7af88f2..9f52070c9 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/posix/atomic.h +++ b/drivers/gpu/nvgpu/include/nvgpu/posix/atomic.h @@ -261,7 +261,7 @@ static inline bool __nvgpu_atomic64_sub_and_test(long x, nvgpu_atomic64_t *v) */ #define cmpxchg(p, old, new) \ ({ \ - typeof(*p) tmp = old; \ + typeof(*(p)) tmp = old; \ \ atomic_compare_exchange_strong(p, &tmp, new); \ tmp; \