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
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2018-10-03 14:52:49 -04:00
committed by mobile promotions
parent f5cac144a0
commit 1c7bb9b538
5 changed files with 5 additions and 5 deletions

View File

@@ -88,7 +88,7 @@ dbg_session_data_from_dbg_s_entry(struct nvgpu_list_node *node)
struct dbg_session_channel_data {
int channel_fd;
int chid;
u32 chid;
struct nvgpu_list_node ch_entry;
struct dbg_session_data *session_data;
int (*unbind_single_channel)(struct dbg_session_gk20a *dbg_s,

View File

@@ -3367,7 +3367,7 @@ u32 *gk20a_runlist_construct_locked(struct fifo_gk20a *f,
/* add runnable channels bound to this TSG */
nvgpu_list_for_each_entry(ch, &tsg->ch_list,
channel_gk20a, ch_entry) {
if (!test_bit(ch->chid,
if (!test_bit((int)ch->chid,
runlist->active_channels)) {
continue;
}

View File

@@ -7975,7 +7975,7 @@ bool gk20a_is_channel_ctx_resident(struct channel_gk20a *ch)
nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gpu_dbg,
"curr_gr_chid=%d curr_tsgid=%d, ch->tsgid=%d"
" ch->chid=%d",
(curr_ch != NULL) ? curr_ch->chid : -1,
(curr_ch != NULL) ? curr_ch->chid : U32_MAX,
curr_gr_tsgid,
ch->tsgid,
ch->chid);

View File

@@ -242,7 +242,7 @@ struct channel_gk20a {
nvgpu_atomic_t bound;
int chid;
u32 chid;
u32 tsgid;
pid_t pid;
pid_t tgid;

View File

@@ -452,7 +452,7 @@ static int dbg_unbind_single_channel_gk20a(struct dbg_session_gk20a *dbg_s,
struct dbg_session_channel_data *ch_data)
{
struct gk20a *g = dbg_s->g;
int chid;
u32 chid;
struct dbg_session_data *session_data;
struct dbg_profiler_object_data *prof_obj, *tmp_obj;
struct dbg_session_channel_data_linux *ch_data_linux;