gpu: nvgpu: Fix ioctl.c w/ disabled ctxsw tracing

ioctl.c defines file_operations structure for ctxsw tracing. The
definition is not protected by the build flag
CONFIG_GK20A_CTXSW_TRACE. Add the protection.

Change-Id: If82d6e2436d18d72b8eb43d490111c7d5ee0b41c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1607577
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-11-29 15:19:16 -08:00
committed by mobile promotions
parent 4e3269cc0b
commit a0ccf3a8d0

View File

@@ -103,6 +103,7 @@ static const struct file_operations gk20a_tsg_ops = {
.unlocked_ioctl = nvgpu_ioctl_tsg_dev_ioctl,
};
#ifdef CONFIG_GK20A_CTXSW_TRACE
static const struct file_operations gk20a_ctxsw_ops = {
.owner = THIS_MODULE,
.release = gk20a_ctxsw_dev_release,
@@ -115,6 +116,7 @@ static const struct file_operations gk20a_ctxsw_ops = {
.read = gk20a_ctxsw_dev_read,
.mmap = gk20a_ctxsw_dev_mmap,
};
#endif
static const struct file_operations gk20a_sched_ops = {
.owner = THIS_MODULE,
@@ -270,7 +272,7 @@ int gk20a_user_init(struct device *dev, const char *interface_name,
if (err)
goto fail;
#ifdef CONFIG_GK20A_CTXSW_TRACE
#if defined(CONFIG_GK20A_CTXSW_TRACE)
err = gk20a_create_device(dev, devno++, interface_name, "-ctxsw",
&l->ctxsw.cdev, &l->ctxsw.node,
&gk20a_ctxsw_ops,