aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/debug.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2013-12-03 05:44:48 -0500
committerThierry Reding <treding@nvidia.com>2013-12-19 03:29:52 -0500
commit8e0d788c6feeb13cbf312acaefa0e91cece0677b (patch)
tree17c37ad169f936c77e797d88d80bc0fc4c406211 /drivers/gpu/host1x/debug.c
parent6f44c2b5280f469f39997c3092a6dd51f9efad6f (diff)
gpu: host1x: Fix build warnings
When debugfs support isn't enabled, gcc complains about some variables being unused. To avoid further #ifdefery, move debugfs specific setup code into static functions and use IS_ENABLED(CONFIG_DEBUG_FS) to have the compiler, rather than the preprocessor, discard them when unused. The advantage of doing it this way is that all the code will be compile-tested whether or not debugfs support is enabled. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x/debug.c')
-rw-r--r--drivers/gpu/host1x/debug.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/host1x/debug.c b/drivers/gpu/host1x/debug.c
index 3ec7d77de24d..ee3d12b51c50 100644
--- a/drivers/gpu/host1x/debug.c
+++ b/drivers/gpu/host1x/debug.c
@@ -96,7 +96,6 @@ static void show_all(struct host1x *m, struct output *o)
96 show_channels(ch, o, true); 96 show_channels(ch, o, true);
97} 97}
98 98
99#ifdef CONFIG_DEBUG_FS
100static void show_all_no_fifo(struct host1x *host1x, struct output *o) 99static void show_all_no_fifo(struct host1x *host1x, struct output *o)
101{ 100{
102 struct host1x_channel *ch; 101 struct host1x_channel *ch;
@@ -153,7 +152,7 @@ static const struct file_operations host1x_debug_fops = {
153 .release = single_release, 152 .release = single_release,
154}; 153};
155 154
156void host1x_debug_init(struct host1x *host1x) 155static void host1x_debugfs_init(struct host1x *host1x)
157{ 156{
158 struct dentry *de = debugfs_create_dir("tegra-host1x", NULL); 157 struct dentry *de = debugfs_create_dir("tegra-host1x", NULL);
159 158
@@ -180,18 +179,22 @@ void host1x_debug_init(struct host1x *host1x)
180 &host1x_debug_force_timeout_channel); 179 &host1x_debug_force_timeout_channel);
181} 180}
182 181
183void host1x_debug_deinit(struct host1x *host1x) 182static void host1x_debugfs_exit(struct host1x *host1x)
184{ 183{
185 debugfs_remove_recursive(host1x->debugfs); 184 debugfs_remove_recursive(host1x->debugfs);
186} 185}
187#else 186
188void host1x_debug_init(struct host1x *host1x) 187void host1x_debug_init(struct host1x *host1x)
189{ 188{
189 if (IS_ENABLED(CONFIG_DEBUG_FS))
190 host1x_debugfs_init(host1x);
190} 191}
192
191void host1x_debug_deinit(struct host1x *host1x) 193void host1x_debug_deinit(struct host1x *host1x)
192{ 194{
195 if (IS_ENABLED(CONFIG_DEBUG_FS))
196 host1x_debugfs_exit(host1x);
193} 197}
194#endif
195 198
196void host1x_debug_dump(struct host1x *host1x) 199void host1x_debug_dump(struct host1x *host1x)
197{ 200{