summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Elcan <pelcan@nvidia.com>2018-10-03 14:52:49 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-02-05 12:04:11 -0500
commited6e3960903b9e2ba82ded06d1abfe3dec0ac865 (patch)
tree057462a363a4281ab8508d7ba6737a078878dd90
parentbace52ac7a5ee8683bedba23721900724e3de30a (diff)
gpu: nvgpu: channel: make chid u32
The chid member of the channel_gk20a struct was being used as a unsigned value. By being declared as an int, it was causing MISRA 10.3 violations for implicit assignment of different types. JIRA NVGPU-647 Change-Id: I7477fad6f0c837cf7ede1dba803158b1dda717af Signed-off-by: Philip Elcan <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1918470 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> (cherry picked from commit 1c7bb9b538200a11aa3ef31d72038d8ba820dfca in dev-kernel) Reviewed-on: https://git-master.nvidia.com/r/2008514 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/channel.h2
-rw-r--r--drivers/gpu/nvgpu/os/linux/ioctl_dbg.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h
index 50002557..fb5ae1fa 100644
--- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h
@@ -88,7 +88,7 @@ dbg_session_data_from_dbg_s_entry(struct nvgpu_list_node *node)
88 88
89struct dbg_session_channel_data { 89struct dbg_session_channel_data {
90 int channel_fd; 90 int channel_fd;
91 int chid; 91 u32 chid;
92 struct nvgpu_list_node ch_entry; 92 struct nvgpu_list_node ch_entry;
93 struct dbg_session_data *session_data; 93 struct dbg_session_data *session_data;
94 int (*unbind_single_channel)(struct dbg_session_gk20a *dbg_s, 94 int (*unbind_single_channel)(struct dbg_session_gk20a *dbg_s,
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index e5ccfcb4..9691d51b 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -3394,7 +3394,7 @@ u32 *gk20a_runlist_construct_locked(struct fifo_gk20a *f,
3394 /* add runnable channels bound to this TSG */ 3394 /* add runnable channels bound to this TSG */
3395 nvgpu_list_for_each_entry(ch, &tsg->ch_list, 3395 nvgpu_list_for_each_entry(ch, &tsg->ch_list,
3396 channel_gk20a, ch_entry) { 3396 channel_gk20a, ch_entry) {
3397 if (!test_bit(ch->chid, 3397 if (!test_bit((int)ch->chid,
3398 runlist->active_channels)) { 3398 runlist->active_channels)) {
3399 continue; 3399 continue;
3400 } 3400 }
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 20c13097..8cb66279 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -8067,7 +8067,7 @@ bool gk20a_is_channel_ctx_resident(struct channel_gk20a *ch)
8067 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gpu_dbg, 8067 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gpu_dbg,
8068 "curr_gr_chid=%d curr_tsgid=%d, ch->tsgid=%d" 8068 "curr_gr_chid=%d curr_tsgid=%d, ch->tsgid=%d"
8069 " ch->chid=%d", 8069 " ch->chid=%d",
8070 (curr_ch != NULL) ? curr_ch->chid : -1, 8070 (curr_ch != NULL) ? curr_ch->chid : U32_MAX,
8071 curr_gr_tsgid, 8071 curr_gr_tsgid,
8072 ch->tsgid, 8072 ch->tsgid,
8073 ch->chid); 8073 ch->chid);
diff --git a/drivers/gpu/nvgpu/include/nvgpu/channel.h b/drivers/gpu/nvgpu/include/nvgpu/channel.h
index 8d2d9b44..6cdcb973 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/channel.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/channel.h
@@ -242,7 +242,7 @@ struct channel_gk20a {
242 242
243 nvgpu_atomic_t bound; 243 nvgpu_atomic_t bound;
244 244
245 int chid; 245 u32 chid;
246 u32 tsgid; 246 u32 tsgid;
247 pid_t pid; 247 pid_t pid;
248 pid_t tgid; 248 pid_t tgid;
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
index 63d33c6b..0dc163e2 100644
--- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
+++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
@@ -456,7 +456,7 @@ static int dbg_unbind_single_channel_gk20a(struct dbg_session_gk20a *dbg_s,
456 struct dbg_session_channel_data *ch_data) 456 struct dbg_session_channel_data *ch_data)
457{ 457{
458 struct gk20a *g = dbg_s->g; 458 struct gk20a *g = dbg_s->g;
459 int chid; 459 u32 chid;
460 struct dbg_session_data *session_data; 460 struct dbg_session_data *session_data;
461 struct dbg_profiler_object_data *prof_obj, *tmp_obj; 461 struct dbg_profiler_object_data *prof_obj, *tmp_obj;
462 struct dbg_session_channel_data_linux *ch_data_linux; 462 struct dbg_session_channel_data_linux *ch_data_linux;