summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-10-10 14:28:03 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-13 18:20:24 -0400
commit2ecd18902e29b8a3615f49afe3c51b2526816be7 (patch)
tree685910de59f9f21542ae9a4c8e32b8a6cba864e1
parent57fb527a7e33384341fc18f1f918d5a8225057f5 (diff)
gpu: nvgpu: Use config in makefile for debug_kmem.c
Conditionally compile debug_kmem.c in the Makefile since the entire file is not needed when CONFIG_NVGPU_TRACK_KMEM_USAGE is not enabled. Removing as many conditional compilation flags from the C code itself is highly desirable from a code complexity standard. Change-Id: If1e87986ca1ee6d71485f1ab40f10c1645c1a628 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1576543 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/Makefile.nvgpu6
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_kmem.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/Makefile.nvgpu b/drivers/gpu/nvgpu/Makefile.nvgpu
index 9ba6f49a..e059002a 100644
--- a/drivers/gpu/nvgpu/Makefile.nvgpu
+++ b/drivers/gpu/nvgpu/Makefile.nvgpu
@@ -137,10 +137,14 @@ nvgpu-$(CONFIG_DEBUG_FS) += \
137 common/linux/debug_mm.o \ 137 common/linux/debug_mm.o \
138 common/linux/debug_allocator.o \ 138 common/linux/debug_allocator.o \
139 common/linux/debug_hal.o \ 139 common/linux/debug_hal.o \
140 common/linux/debug_kmem.o \
141 common/linux/debug_clk.o \ 140 common/linux/debug_clk.o \
142 common/linux/debug_xve.o 141 common/linux/debug_xve.o
143 142
143ifeq ($(CONFIG_NVGPU_TRACK_MEM_USAGE),y)
144nvgpu-$(CONFIG_DEBUG_FS) += \
145 common/linux/debug_kmem.o
146endif
147
144nvgpu-$(CONFIG_TEGRA_GK20A) += common/linux/platform_gk20a_tegra.o 148nvgpu-$(CONFIG_TEGRA_GK20A) += common/linux/platform_gk20a_tegra.o
145nvgpu-$(CONFIG_SYNC) += gk20a/sync_gk20a.o 149nvgpu-$(CONFIG_SYNC) += gk20a/sync_gk20a.o
146nvgpu-$(CONFIG_GK20A_PCI) += common/linux/pci.o 150nvgpu-$(CONFIG_GK20A_PCI) += common/linux/pci.o
diff --git a/drivers/gpu/nvgpu/common/linux/debug_kmem.c b/drivers/gpu/nvgpu/common/linux/debug_kmem.c
index 04fb8b68..a0c7d47d 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_kmem.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_kmem.c
@@ -18,7 +18,6 @@
18#include "debug_kmem.h" 18#include "debug_kmem.h"
19#include "kmem_priv.h" 19#include "kmem_priv.h"
20 20
21#ifdef CONFIG_NVGPU_TRACK_MEM_USAGE
22/** 21/**
23 * to_human_readable_bytes - Determine suffix for passed size. 22 * to_human_readable_bytes - Determine suffix for passed size.
24 * 23 *
@@ -311,4 +310,3 @@ void nvgpu_kmem_debugfs_init(struct gk20a *g)
311 l->debugfs_kmem, 310 l->debugfs_kmem,
312 g, &__kmem_traces_fops); 311 g, &__kmem_traces_fops);
313} 312}
314#endif