summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-02-20 20:50:24 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-03-16 10:34:45 -0400
commitd4382ed094fc831d40a229acc150f1a1349ee9f1 (patch)
treebab99c791b9cfa8ce4335d0ce61dbfb119516c9c /drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
parent0725ff9372edc7e096a9d5e82b1fa8d28abcba60 (diff)
gpu: nvgpu: Use asid only under CONFIG_SYNC in channel_sync_gk20a.c
This variable is only ever used under the CONFIG_SYNC config so make sure that we only define/assign to it when CONFIG_SYNC is enabled. JIRA NVGPU-525 Change-Id: I27160adbd6a46f58e21f24ab19d37966ded5e7de Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1673812 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
index c6b55bf8..e896eb88 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
@@ -893,9 +893,11 @@ static void gk20a_channel_semaphore_destroy(struct gk20a_channel_sync *s)
893static struct gk20a_channel_sync * 893static struct gk20a_channel_sync *
894gk20a_channel_semaphore_create(struct channel_gk20a *c, bool user_managed) 894gk20a_channel_semaphore_create(struct channel_gk20a *c, bool user_managed)
895{ 895{
896 int asid = -1;
897 struct gk20a_channel_semaphore *sema; 896 struct gk20a_channel_semaphore *sema;
898 char pool_name[20]; 897 char pool_name[20];
898#ifdef CONFIG_SYNC
899 int asid = -1;
900#endif
899 901
900 if (WARN_ON(!c->vm)) 902 if (WARN_ON(!c->vm))
901 return NULL; 903 return NULL;
@@ -905,13 +907,13 @@ gk20a_channel_semaphore_create(struct channel_gk20a *c, bool user_managed)
905 return NULL; 907 return NULL;
906 sema->c = c; 908 sema->c = c;
907 909
908 if (c->vm->as_share)
909 asid = c->vm->as_share->id;
910
911 sprintf(pool_name, "semaphore_pool-%d", c->chid); 910 sprintf(pool_name, "semaphore_pool-%d", c->chid);
912 sema->pool = c->vm->sema_pool; 911 sema->pool = c->vm->sema_pool;
913 912
914#ifdef CONFIG_SYNC 913#ifdef CONFIG_SYNC
914 if (c->vm->as_share)
915 asid = c->vm->as_share->id;
916
915 sema->timeline = gk20a_sync_timeline_create( 917 sema->timeline = gk20a_sync_timeline_create(
916 "gk20a_ch%d_as%d", c->chid, asid); 918 "gk20a_ch%d_as%d", c->chid, asid);
917 if (!sema->timeline) { 919 if (!sema->timeline) {