diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-11-29 18:19:16 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-12-01 11:38:17 -0500 |
commit | a0ccf3a8d07ebc0fdc271c7392597c9ac21f9fae (patch) | |
tree | c335f415b9b5b6ec026375190bb174e2856f5189 /drivers/gpu/nvgpu/common/linux | |
parent | 4e3269cc0bf1c1bf27a78000b2e980be87acd499 (diff) |
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>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl.c b/drivers/gpu/nvgpu/common/linux/ioctl.c index 0aa7f6a3..04974786 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl.c | |||
@@ -103,6 +103,7 @@ static const struct file_operations gk20a_tsg_ops = { | |||
103 | .unlocked_ioctl = nvgpu_ioctl_tsg_dev_ioctl, | 103 | .unlocked_ioctl = nvgpu_ioctl_tsg_dev_ioctl, |
104 | }; | 104 | }; |
105 | 105 | ||
106 | #ifdef CONFIG_GK20A_CTXSW_TRACE | ||
106 | static const struct file_operations gk20a_ctxsw_ops = { | 107 | static const struct file_operations gk20a_ctxsw_ops = { |
107 | .owner = THIS_MODULE, | 108 | .owner = THIS_MODULE, |
108 | .release = gk20a_ctxsw_dev_release, | 109 | .release = gk20a_ctxsw_dev_release, |
@@ -115,6 +116,7 @@ static const struct file_operations gk20a_ctxsw_ops = { | |||
115 | .read = gk20a_ctxsw_dev_read, | 116 | .read = gk20a_ctxsw_dev_read, |
116 | .mmap = gk20a_ctxsw_dev_mmap, | 117 | .mmap = gk20a_ctxsw_dev_mmap, |
117 | }; | 118 | }; |
119 | #endif | ||
118 | 120 | ||
119 | static const struct file_operations gk20a_sched_ops = { | 121 | static const struct file_operations gk20a_sched_ops = { |
120 | .owner = THIS_MODULE, | 122 | .owner = THIS_MODULE, |
@@ -270,7 +272,7 @@ int gk20a_user_init(struct device *dev, const char *interface_name, | |||
270 | if (err) | 272 | if (err) |
271 | goto fail; | 273 | goto fail; |
272 | 274 | ||
273 | #ifdef CONFIG_GK20A_CTXSW_TRACE | 275 | #if defined(CONFIG_GK20A_CTXSW_TRACE) |
274 | err = gk20a_create_device(dev, devno++, interface_name, "-ctxsw", | 276 | err = gk20a_create_device(dev, devno++, interface_name, "-ctxsw", |
275 | &l->ctxsw.cdev, &l->ctxsw.node, | 277 | &l->ctxsw.cdev, &l->ctxsw.node, |
276 | &gk20a_ctxsw_ops, | 278 | &gk20a_ctxsw_ops, |