From 0a9f633fc3d5a8d9d397d540191a50c00a00385a Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Fri, 23 Aug 2019 11:55:46 +0530 Subject: [PATCH] gpu: nvgpu: update the get_field_value macro emit This patch fixes the below misra violation for the get_field_value macro emit. misra_c_2012_rule_20_7_violation: Macro parameter expands into an expression without being wrapped by parentheses. Jira NVGPU-3881 Signed-off-by: Debarshi Dutta Change-Id: I0ab94a0b6b6bf67c1dddb96a99a6a5cd647b948e Reviewed-on: https://git-master.nvidia.com/r/2181761 Reviewed-by: Sagar Kamble Reviewed-by: Thomas Fleury GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fifo_gk20a.h | 2 +- drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fifo_gm20b.h | 2 +- drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fuse_gm20b.h | 2 +- drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fifo_gp10b.h | 2 +- drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fuse_gp10b.h | 2 +- drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fifo_gv11b.h | 4 ++-- drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fuse_gv11b.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fifo_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fifo_gk20a.h index e02437599..0a01daa79 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fifo_gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fifo_gk20a.h @@ -149,7 +149,7 @@ #define fifo_intr_pbdma_id_status_f(v, i)\ ((U32(v) & 0x1U) << (0U + (i)*1U)) #define fifo_intr_pbdma_id_status_v(r, i)\ - (((r) >> (0U + i*1U)) & 0x1U) + (((r) >> (0U + (i)*1U)) & 0x1U) #define fifo_intr_pbdma_id_status__size_1_v() (0x00000001U) #define fifo_intr_runlist_r() (0x00002a00U) #define fifo_fb_timeout_r() (0x00002a04U) diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fifo_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fifo_gm20b.h index 9ec525380..3f0244315 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fifo_gm20b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fifo_gm20b.h @@ -138,7 +138,7 @@ #define fifo_intr_pbdma_id_status_f(v, i)\ ((U32(v) & 0x1U) << (0U + (i)*1U)) #define fifo_intr_pbdma_id_status_v(r, i)\ - (((r) >> (0U + i*1U)) & 0x1U) + (((r) >> (0U + (i)*1U)) & 0x1U) #define fifo_intr_pbdma_id_status__size_1_v() (0x00000001U) #define fifo_intr_runlist_r() (0x00002a00U) #define fifo_fb_timeout_r() (0x00002a04U) diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fuse_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fuse_gm20b.h index db72b96f9..39b26fb4a 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fuse_gm20b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fuse_gm20b.h @@ -82,7 +82,7 @@ (nvgpu_safe_add_u32(0x00021d70U, nvgpu_safe_mult_u32((i), 4U))) #define fuse_status_opt_fbp_r() (0x00021d38U) #define fuse_status_opt_fbp_idx_v(r, i)\ - (((r) >> (0U + i*1U)) & 0x1U) + (((r) >> (0U + (i)*1U)) & 0x1U) #define fuse_opt_sec_debug_en_r() (0x00021218U) #define fuse_opt_priv_sec_en_r() (0x00021434U) #endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fifo_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fifo_gp10b.h index 01d80d995..bb9973f11 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fifo_gp10b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fifo_gp10b.h @@ -139,7 +139,7 @@ #define fifo_intr_pbdma_id_status_f(v, i)\ ((U32(v) & 0x1U) << (0U + (i)*1U)) #define fifo_intr_pbdma_id_status_v(r, i)\ - (((r) >> (0U + i*1U)) & 0x1U) + (((r) >> (0U + (i)*1U)) & 0x1U) #define fifo_intr_pbdma_id_status__size_1_v() (0x00000001U) #define fifo_intr_runlist_r() (0x00002a00U) #define fifo_fb_timeout_r() (0x00002a04U) diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fuse_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fuse_gp10b.h index f74b66d4f..a3df120f1 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fuse_gp10b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fuse_gp10b.h @@ -82,7 +82,7 @@ (nvgpu_safe_add_u32(0x00021d70U, nvgpu_safe_mult_u32((i), 4U))) #define fuse_status_opt_fbp_r() (0x00021d38U) #define fuse_status_opt_fbp_idx_v(r, i)\ - (((r) >> (0U + i*1U)) & 0x1U) + (((r) >> (0U + (i)*1U)) & 0x1U) #define fuse_opt_ecc_en_r() (0x00021228U) #define fuse_opt_feature_fuses_override_disable_r() (0x000213f0U) #define fuse_opt_sec_debug_en_r() (0x00021218U) diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fifo_gv11b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fifo_gv11b.h index 257466bd1..395e63605 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fifo_gv11b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fifo_gv11b.h @@ -118,7 +118,7 @@ #define fifo_intr_ctxsw_timeout_engine_f(v, i)\ ((U32(v) & 0x1U) << (0U + (i)*1U)) #define fifo_intr_ctxsw_timeout_engine_v(r, i)\ - (((r) >> (0U + i*1U)) & 0x1U) + (((r) >> (0U + (i)*1U)) & 0x1U) #define fifo_intr_ctxsw_timeout_engine__size_1_v() (0x00000020U) #define fifo_intr_ctxsw_timeout_engine_pending_v() (0x00000001U) #define fifo_intr_ctxsw_timeout_engine_pending_f(i)\ @@ -141,7 +141,7 @@ #define fifo_intr_pbdma_id_status_f(v, i)\ ((U32(v) & 0x1U) << (0U + (i)*1U)) #define fifo_intr_pbdma_id_status_v(r, i)\ - (((r) >> (0U + i*1U)) & 0x1U) + (((r) >> (0U + (i)*1U)) & 0x1U) #define fifo_intr_pbdma_id_status__size_1_v() (0x00000003U) #define fifo_intr_runlist_r() (0x00002a00U) #define fifo_fb_timeout_r() (0x00002a04U) diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fuse_gv11b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fuse_gv11b.h index 9cff123ba..86100e403 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fuse_gv11b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_fuse_gv11b.h @@ -82,7 +82,7 @@ (nvgpu_safe_add_u32(0x00021d70U, nvgpu_safe_mult_u32((i), 4U))) #define fuse_status_opt_fbp_r() (0x00021d38U) #define fuse_status_opt_fbp_idx_v(r, i)\ - (((r) >> (0U + i*1U)) & 0x1U) + (((r) >> (0U + (i)*1U)) & 0x1U) #define fuse_opt_ecc_en_r() (0x00021228U) #define fuse_opt_feature_fuses_override_disable_r() (0x000213f0U) #define fuse_opt_sec_debug_en_r() (0x00021218U)