From a2ff35ad9e73ed563ef8b29b702c5cbc89c7a74e Mon Sep 17 00:00:00 2001 From: ajesh Date: Thu, 2 May 2019 17:20:58 +0530 Subject: [PATCH] gpu: nvgpu: fix MISRA violation in cond unit MISRA 20.7 rule requires macro paramaters to be wrapped in parantheses when the parameter expands into an expression. Fix the MISRA rule 20.7 violation in posix cond unit. Jira NVGPU-3139 Change-Id: Iae1f90a905e73cc0b3104ccab98bcabc81605452 Signed-off-by: ajesh Reviewed-on: https://git-master.nvidia.com/r/2110264 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Nicolas Benech Reviewed-by: Adeel Raza Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/posix/cond.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/posix/cond.h b/drivers/gpu/nvgpu/include/nvgpu/posix/cond.h index 429cc88a7..de9c1e3c1 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/posix/cond.h +++ b/drivers/gpu/nvgpu/include/nvgpu/posix/cond.h @@ -69,14 +69,14 @@ void nvgpu_cond_unlock(struct nvgpu_cond *cond); * Wait for a condition to become true. Returns -ETIMEOUT if * the wait timed out with condition false. */ -#define NVGPU_COND_WAIT(cond, condition, timeout_ms) \ -({ \ - int ret = 0; \ - nvgpu_mutex_acquire(&(cond)->mutex); \ - NVGPU_COND_WAIT_TIMEOUT_LOCKED(cond, condition, ret, \ - timeout_ms ? timeout_ms : (unsigned int)-1); \ - nvgpu_mutex_release(&(cond)->mutex); \ - ret; \ +#define NVGPU_COND_WAIT(cond, condition, timeout_ms) \ +({ \ + int ret = 0; \ + nvgpu_mutex_acquire(&(cond)->mutex); \ + NVGPU_COND_WAIT_TIMEOUT_LOCKED((cond), (condition), (ret), \ + (timeout_ms) ? (timeout_ms) : ((unsigned int)-1)); \ + nvgpu_mutex_release(&(cond)->mutex); \ + ret; \ }) /**