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>
This commit is contained in:
Alex Waterman
2018-02-20 17:50:24 -08:00
committed by mobile promotions
parent 0725ff9372
commit d4382ed094

View File

@@ -893,9 +893,11 @@ static void gk20a_channel_semaphore_destroy(struct gk20a_channel_sync *s)
static struct gk20a_channel_sync *
gk20a_channel_semaphore_create(struct channel_gk20a *c, bool user_managed)
{
int asid = -1;
struct gk20a_channel_semaphore *sema;
char pool_name[20];
#ifdef CONFIG_SYNC
int asid = -1;
#endif
if (WARN_ON(!c->vm))
return NULL;
@@ -905,13 +907,13 @@ gk20a_channel_semaphore_create(struct channel_gk20a *c, bool user_managed)
return NULL;
sema->c = c;
if (c->vm->as_share)
asid = c->vm->as_share->id;
sprintf(pool_name, "semaphore_pool-%d", c->chid);
sema->pool = c->vm->sema_pool;
#ifdef CONFIG_SYNC
if (c->vm->as_share)
asid = c->vm->as_share->id;
sema->timeline = gk20a_sync_timeline_create(
"gk20a_ch%d_as%d", c->chid, asid);
if (!sema->timeline) {