gpu: nvgpu: modify the prints for return values

Modify the prints for certain OS API return values for non safe build.

Jira NVGPU-4987

Change-Id: I7c3eba58b5c685fbf654b7093e4d2180e02c49a6
Signed-off-by: ajesh <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2324992
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@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:
ajesh
2020-04-07 11:36:15 +05:30
committed by Alex Waterman
parent 0e0b966f0c
commit e4285740a4
2 changed files with 6 additions and 2 deletions

View File

@@ -159,12 +159,14 @@ void nvgpu_cond_destroy(struct nvgpu_cond *cond)
if (cond == NULL) { if (cond == NULL) {
BUG(); BUG();
} }
#ifndef CONFIG_NVGPU_NON_FUSA
err = pthread_cond_destroy(&cond->cond); err = pthread_cond_destroy(&cond->cond);
if (err != 0) { if (err != 0) {
nvgpu_err(NULL, "OS API pthread_cond_destroy error = %d", err); nvgpu_err(NULL, "OS API pthread_cond_destroy error = %d", err);
} }
#ifndef CONFIG_NVGPU_NON_FUSA
nvgpu_assert(err == 0); nvgpu_assert(err == 0);
#else
(void) pthread_cond_destroy(&cond->cond);
#endif #endif
nvgpu_mutex_destroy(&cond->mutex); nvgpu_mutex_destroy(&cond->mutex);
err = pthread_condattr_destroy(&cond->attr); err = pthread_condattr_destroy(&cond->attr);

View File

@@ -47,12 +47,14 @@ int nvgpu_mutex_tryacquire(struct nvgpu_mutex *mutex)
void nvgpu_mutex_destroy(struct nvgpu_mutex *mutex) void nvgpu_mutex_destroy(struct nvgpu_mutex *mutex)
{ {
#ifndef CONFIG_NVGPU_NON_FUSA
int err = pthread_mutex_destroy(&mutex->lock.mutex); int err = pthread_mutex_destroy(&mutex->lock.mutex);
if (err != 0) { if (err != 0) {
nvgpu_info(NULL, "Mutex destroy error %d", err); nvgpu_info(NULL, "Mutex destroy error %d", err);
} }
#ifndef CONFIG_NVGPU_NON_FUSA
nvgpu_assert(err == 0); nvgpu_assert(err == 0);
#else
(void) pthread_mutex_destroy(&mutex->lock.mutex);
#endif #endif
} }