mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: posix: fix atomic test ops
Previously atomic test ops were simply returning the atomic value as a boolean. Instead the test ops had to check if the value had reached 0. Change-Id: Ib84ec4f78ddb25604e39c3e78272857899805b7b Signed-off-by: Adeel Raza <araza@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2018758 Reviewed-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@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
c3ea3e283f
commit
ac24a33a76
@@ -102,19 +102,19 @@ static inline int __nvgpu_atomic_xchg(nvgpu_atomic_t *v, int new)
|
||||
static inline bool __nvgpu_atomic_inc_and_test(nvgpu_atomic_t *v)
|
||||
{
|
||||
v->v++;
|
||||
return v->v ? true : false;
|
||||
return (v->v == 0);
|
||||
}
|
||||
|
||||
static inline bool __nvgpu_atomic_dec_and_test(nvgpu_atomic_t *v)
|
||||
{
|
||||
v->v--;
|
||||
return v->v ? true : false;
|
||||
return (v->v == 0);
|
||||
}
|
||||
|
||||
static inline bool __nvgpu_atomic_sub_and_test(int i, nvgpu_atomic_t *v)
|
||||
{
|
||||
v->v -= i;
|
||||
return v->v ? true : false;
|
||||
return (v->v == 0);
|
||||
}
|
||||
|
||||
static inline int __nvgpu_atomic_add_return(int i, nvgpu_atomic_t *v)
|
||||
|
||||
Reference in New Issue
Block a user