gpu: nvgpu: fix misra 8.13 violation

MISRA Advisory Rule 8.13 states that a pointer should point to a
const-qualified type wherever possible.

This change eliminates such violations from the use of
nvgpu_timeout_expired_msg_cpu() by marking the temporary
struct nvgpu_timeout pointer const.

Jira NVGPU-3178

Change-Id: Id0c77f2a18db29dcc1125540fdc02ab246c68092
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2283774
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Adeel Raza <araza@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:
Scott Long
2020-01-22 11:17:29 -08:00
committed by Alex Waterman
parent bbaea596ea
commit 1f2f414fde

View File

@@ -46,7 +46,7 @@
*/
#define nvgpu_timeout_expired_msg_cpu(timeout, caller, fmt, arg...) \
({ \
struct nvgpu_timeout *t_ptr = (timeout); \
const struct nvgpu_timeout *t_ptr = (timeout); \
int ret_cpu = 0; \
if (nvgpu_current_time_ns() > t_ptr->time) { \
if ((t_ptr->flags & NVGPU_TIMER_SILENT_TIMEOUT) == 0U) { \