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 <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2110264
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
ajesh
2019-05-02 17:20:58 +05:30
committed by mobile promotions
parent baa6fb3546
commit a2ff35ad9e

View File

@@ -69,14 +69,14 @@ void nvgpu_cond_unlock(struct nvgpu_cond *cond);
* Wait for a condition to become true. Returns -ETIMEOUT if * Wait for a condition to become true. Returns -ETIMEOUT if
* the wait timed out with condition false. * the wait timed out with condition false.
*/ */
#define NVGPU_COND_WAIT(cond, condition, timeout_ms) \ #define NVGPU_COND_WAIT(cond, condition, timeout_ms) \
({ \ ({ \
int ret = 0; \ int ret = 0; \
nvgpu_mutex_acquire(&(cond)->mutex); \ nvgpu_mutex_acquire(&(cond)->mutex); \
NVGPU_COND_WAIT_TIMEOUT_LOCKED(cond, condition, ret, \ NVGPU_COND_WAIT_TIMEOUT_LOCKED((cond), (condition), (ret), \
timeout_ms ? timeout_ms : (unsigned int)-1); \ (timeout_ms) ? (timeout_ms) : ((unsigned int)-1)); \
nvgpu_mutex_release(&(cond)->mutex); \ nvgpu_mutex_release(&(cond)->mutex); \
ret; \ ret; \
}) })
/** /**