gpu: nvgpu: unit: atomic: Use labs when operating on long

Use labs() instead of abs() when operating with longs.

Change-Id: Ibb1f2c69099387478b41b66cf68539b460bc2be3
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2318390
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2020-03-25 10:41:15 -07:00
committed by Alex Waterman
parent caf9ba229f
commit cc2e1be0bb

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -775,7 +775,7 @@ int test_atomic_arithmetic_threaded(struct unit_module *m,
/* sanity test that the threads aren't all sequential */
bool sequential = true;
for (i = 0; i < (num_threads - 1); i++) {
if (abs(threads[i].final_val - threads[i+1].final_val)
if (labs(threads[i].final_val - threads[i+1].final_val)
!= (long)args->loop_count) {
sequential = false;
break;