From c5f873fa3199a093d24d48aa386efc28f2cfbe95 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Wed, 1 May 2019 13:46:02 -0700 Subject: [PATCH] gpu: nvgpu: runlist MISRA fixes for Rule 10.3 Using u32 with bitops like for_each_set_bit results in MISRA violation as bitops internally uses unsigned long. Define tsgid as unsigned long an use (u32) cast when needed. Jira NVGPU-3379 Change-Id: I99f9dae18ee74223de40dd5990bfad4eee2f4559 Signed-off-by: Thomas Fleury Reviewed-on: https://git-master.nvidia.com/r/2109680 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Philip Elcan Reviewed-by: Adeel Raza Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/runlist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/common/fifo/runlist.c b/drivers/gpu/nvgpu/common/fifo/runlist.c index 36542663e..747d67683 100644 --- a/drivers/gpu/nvgpu/common/fifo/runlist.c +++ b/drivers/gpu/nvgpu/common/fifo/runlist.c @@ -134,7 +134,7 @@ static u32 nvgpu_runlist_append_prio(struct fifo_gk20a *f, nvgpu_log_fn(f->g, " "); for_each_set_bit(tsgid, runlist->active_tsgs, f->num_channels) { - struct tsg_gk20a *tsg = nvgpu_tsg_get_from_id(f->g, tsgid); + struct tsg_gk20a *tsg = nvgpu_tsg_get_from_id(f->g, (u32)tsgid); u32 entries; if (tsg->interleave_level == interleave_level) { @@ -177,7 +177,7 @@ static u32 nvgpu_runlist_append_med(struct fifo_gk20a *f, nvgpu_log_fn(f->g, " "); for_each_set_bit(tsgid, runlist->active_tsgs, f->num_channels) { - struct tsg_gk20a *tsg = nvgpu_tsg_get_from_id(f->g, tsgid); + struct tsg_gk20a *tsg = nvgpu_tsg_get_from_id(f->g, (u32)tsgid); u32 entries; if (tsg->interleave_level != @@ -216,7 +216,7 @@ static u32 nvgpu_runlist_append_low(struct fifo_gk20a *f, nvgpu_log_fn(f->g, " "); for_each_set_bit(tsgid, runlist->active_tsgs, f->num_channels) { - struct tsg_gk20a *tsg = nvgpu_tsg_get_from_id(f->g, tsgid); + struct tsg_gk20a *tsg = nvgpu_tsg_get_from_id(f->g, (u32)tsgid); u32 entries; if (tsg->interleave_level !=