From e4285740a48a838a52903135bae04ae43a36a01f Mon Sep 17 00:00:00 2001 From: ajesh Date: Tue, 7 Apr 2020 11:36:15 +0530 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2324992 Reviewed-by: automaticguardword Reviewed-by: Shashank Singh Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Vaibhav Kachore Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/posix/cond.c | 4 +++- drivers/gpu/nvgpu/os/posix/lock.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/os/posix/cond.c b/drivers/gpu/nvgpu/os/posix/cond.c index d8cff043d..858caa449 100644 --- a/drivers/gpu/nvgpu/os/posix/cond.c +++ b/drivers/gpu/nvgpu/os/posix/cond.c @@ -159,12 +159,14 @@ void nvgpu_cond_destroy(struct nvgpu_cond *cond) if (cond == NULL) { BUG(); } +#ifndef CONFIG_NVGPU_NON_FUSA err = pthread_cond_destroy(&cond->cond); if (err != 0) { nvgpu_err(NULL, "OS API pthread_cond_destroy error = %d", err); } -#ifndef CONFIG_NVGPU_NON_FUSA nvgpu_assert(err == 0); +#else + (void) pthread_cond_destroy(&cond->cond); #endif nvgpu_mutex_destroy(&cond->mutex); err = pthread_condattr_destroy(&cond->attr); diff --git a/drivers/gpu/nvgpu/os/posix/lock.c b/drivers/gpu/nvgpu/os/posix/lock.c index 07feee53f..edfac42ab 100644 --- a/drivers/gpu/nvgpu/os/posix/lock.c +++ b/drivers/gpu/nvgpu/os/posix/lock.c @@ -47,12 +47,14 @@ int nvgpu_mutex_tryacquire(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); if (err != 0) { nvgpu_info(NULL, "Mutex destroy error %d", err); } -#ifndef CONFIG_NVGPU_NON_FUSA nvgpu_assert(err == 0); +#else + (void) pthread_mutex_destroy(&mutex->lock.mutex); #endif }