From a0ccf3a8d07ebc0fdc271c7392597c9ac21f9fae Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 29 Nov 2017 15:19:16 -0800 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1607577 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers') 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 = { .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, -- cgit v1.2.2