From b3e1ce04b963e91b9b425b3c35cc4eff11db7543 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 21 Apr 2017 12:42:57 -0700 Subject: gpu: nvgpu: Put debugfs dependencies inside #ifdef Put all debugfs dependencies inside #ifdef CONFIG_DEBUG_FS. This includes some functions in allocators that were used only for debugging. Remove include of linux/debugfs.h on files that do not deal with debugfs. linux/debugfs.h implicitly included linux/fs.h, which we relied on. Add explicit include of linux/fs.h for all files where this is the case. Change-Id: I16feffae6b0e3a2edf366075cdc01ade86be06f9 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1467897 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/mm/lockless_allocator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/common/mm/lockless_allocator.c') diff --git a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c index dc72d8bf..d8043c0b 100644 --- a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -106,6 +106,7 @@ static void nvgpu_lockless_alloc_destroy(struct nvgpu_allocator *a) nvgpu_kfree(nvgpu_alloc_to_gpu(a), pa); } +#ifdef CONFIG_DEBUG_FS static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a, struct seq_file *s, int lock) { @@ -122,6 +123,7 @@ static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a, __alloc_pstat(s, a, " Number free = %d\n", pa->nr_nodes - atomic_read(&pa->nr_allocs)); } +#endif static const struct nvgpu_allocator_ops pool_ops = { .alloc = nvgpu_lockless_alloc, @@ -134,7 +136,9 @@ static const struct nvgpu_allocator_ops pool_ops = { .fini = nvgpu_lockless_alloc_destroy, +#ifdef CONFIG_DEBUG_FS .print_stats = nvgpu_lockless_print_stats, +#endif }; int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a, -- cgit v1.2.2