mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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 <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2070064 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Tejal Kudav <tkudav@nvidia.com> Reviewed-by: Adeel Raza <araza@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
56219f7c10
commit
f087ec0826
@@ -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; \
|
||||
|
||||
Reference in New Issue
Block a user