gpu: nvgpu: tsg MISRA fixes for Rule 14.2

nvgpu_list_for_each_entry_safe violates MISRA Rule 14.2, as
it uses comma separator in the for clauses. Use a while loop
instead in nvgpu_tsg_release, as we want to empty the list.

Jira NVGPU-3380

Change-Id: I38211cc326e458d0912f374e3692328fb4e9b191
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2111383
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Thomas Fleury
2019-05-03 09:17:34 -07:00
committed by mobile promotions
parent e852ea6f2a
commit e6638354e9

View File

@@ -731,7 +731,6 @@ void nvgpu_tsg_release(struct nvgpu_ref *ref)
{
struct tsg_gk20a *tsg = tsg_gk20a_from_ref(ref);
struct gk20a *g = tsg->g;
struct gk20a_event_id_data *event_id_data, *event_id_data_temp;
if (tsg->gr_ctx != NULL && nvgpu_mem_is_valid(
nvgpu_gr_ctx_get_ctx_mem(tsg->gr_ctx)) &&
@@ -741,18 +740,15 @@ void nvgpu_tsg_release(struct nvgpu_ref *ref)
/* unhook all events created on this TSG */
nvgpu_mutex_acquire(&tsg->event_id_list_lock);
nvgpu_list_for_each_entry_safe(event_id_data, event_id_data_temp,
&tsg->event_id_list,
gk20a_event_id_data,
event_id_node) {
nvgpu_list_del(&event_id_data->event_id_node);
while (nvgpu_list_empty(&tsg->event_id_list) == false) {
nvgpu_list_del(tsg->event_id_list.next);
}
nvgpu_mutex_release(&tsg->event_id_list_lock);
nvgpu_tsg_release_common(g, tsg);
release_used_tsg(&g->fifo, tsg);
nvgpu_log(g, gpu_dbg_fn, "tsg released %d\n", tsg->tsgid);
nvgpu_log(g, gpu_dbg_fn, "tsg released %d", tsg->tsgid);
}
struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch)