From 1f2f414fdeece904a3df92599227f2a5f299df7c Mon Sep 17 00:00:00 2001 From: Scott Long Date: Wed, 22 Jan 2020 11:17:29 -0800 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2283774 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Adeel Raza Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/posix/timers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/posix/timers.h b/drivers/gpu/nvgpu/include/nvgpu/posix/timers.h index bd614f01b..e3572e487 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/posix/timers.h +++ b/drivers/gpu/nvgpu/include/nvgpu/posix/timers.h @@ -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) { \