aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-01 07:10:00 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-01 14:15:56 -0400
commit2739deaece4bc25fba5df0566423f4a11c3f4e84 (patch)
tree13df74902bed941f5662db8b37ca493af5a7f0da
parent0723103f8ba15a019bbcaf6f130d73d05337332f (diff)
staging: vc04_services: remove odd vchiq_debugfs_top() wrapper
vchiq_debugfs_top() is only a wrapper around a pointer to a dentry, so just use the dentry directly instead, making it a static variable instead of part of a static structure. This also removes the pointless BUG_ON() when checking that dentry as no one should ever care if debugfs is working or not, and the kernel should really not panic over something as trivial as that. Suggested-by: Eric Anholt <eric@anholt.net> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Kees Cook <keescook@chromium.org> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Keerthi Reddy <keerthigd4990@gmail.com> Cc: linux-rpi-kernel@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
index 103fec955e2c..8b46256a97fc 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
@@ -53,9 +53,6 @@
53 53
54/* Top-level debug info */ 54/* Top-level debug info */
55struct vchiq_debugfs_info { 55struct vchiq_debugfs_info {
56 /* Global 'vchiq' debugfs entry used by all instances */
57 struct dentry *vchiq_cfg_dir;
58
59 /* one entry per client process */ 56 /* one entry per client process */
60 struct dentry *clients; 57 struct dentry *clients;
61 58
@@ -65,6 +62,9 @@ struct vchiq_debugfs_info {
65 62
66static struct vchiq_debugfs_info debugfs_info; 63static struct vchiq_debugfs_info debugfs_info;
67 64
65/* Global 'vchiq' debugfs entry used by all instances */
66struct dentry *vchiq_dbg_dir;
67
68/* Log category debugfs entries */ 68/* Log category debugfs entries */
69struct vchiq_debugfs_log_entry { 69struct vchiq_debugfs_log_entry {
70 const char *name; 70 const char *name;
@@ -82,7 +82,6 @@ static struct vchiq_debugfs_log_entry vchiq_debugfs_log_entries[] = {
82static int n_log_entries = ARRAY_SIZE(vchiq_debugfs_log_entries); 82static int n_log_entries = ARRAY_SIZE(vchiq_debugfs_log_entries);
83 83
84static struct dentry *vchiq_clients_top(void); 84static struct dentry *vchiq_clients_top(void);
85static struct dentry *vchiq_debugfs_top(void);
86 85
87static int debugfs_log_show(struct seq_file *f, void *offset) 86static int debugfs_log_show(struct seq_file *f, void *offset)
88{ 87{
@@ -163,7 +162,7 @@ static void vchiq_debugfs_create_log_entries(struct dentry *top)
163 struct dentry *dir; 162 struct dentry *dir;
164 size_t i; 163 size_t i;
165 164
166 dir = debugfs_create_dir("log", vchiq_debugfs_top()); 165 dir = debugfs_create_dir("log", vchiq_dbg_dir);
167 debugfs_info.log_categories = dir; 166 debugfs_info.log_categories = dir;
168 167
169 for (i = 0; i < n_log_entries; i++) { 168 for (i = 0; i < n_log_entries; i++) {
@@ -286,17 +285,16 @@ void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance)
286 285
287void vchiq_debugfs_init(void) 286void vchiq_debugfs_init(void)
288{ 287{
289 debugfs_info.vchiq_cfg_dir = debugfs_create_dir("vchiq", NULL); 288 vchiq_dbg_dir = debugfs_create_dir("vchiq", NULL);
290 debugfs_info.clients = debugfs_create_dir("clients", 289 debugfs_info.clients = debugfs_create_dir("clients", vchiq_dbg_dir);
291 vchiq_debugfs_top());
292 290
293 vchiq_debugfs_create_log_entries(vchiq_debugfs_top()); 291 vchiq_debugfs_create_log_entries(vchiq_dbg_dir);
294} 292}
295 293
296/* remove all the debugfs entries */ 294/* remove all the debugfs entries */
297void vchiq_debugfs_deinit(void) 295void vchiq_debugfs_deinit(void)
298{ 296{
299 debugfs_remove_recursive(vchiq_debugfs_top()); 297 debugfs_remove_recursive(vchiq_dbg_dir);
300} 298}
301 299
302static struct dentry *vchiq_clients_top(void) 300static struct dentry *vchiq_clients_top(void)
@@ -304,12 +302,6 @@ static struct dentry *vchiq_clients_top(void)
304 return debugfs_info.clients; 302 return debugfs_info.clients;
305} 303}
306 304
307static struct dentry *vchiq_debugfs_top(void)
308{
309 BUG_ON(debugfs_info.vchiq_cfg_dir == NULL);
310 return debugfs_info.vchiq_cfg_dir;
311}
312
313#else /* CONFIG_DEBUG_FS */ 305#else /* CONFIG_DEBUG_FS */
314 306
315void vchiq_debugfs_init(void) 307void vchiq_debugfs_init(void)