aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-01 07:10:04 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-01 14:15:56 -0400
commit3b93c0f4b6accb8105152900d7e414593a8b0c79 (patch)
tree1615f0f3c7a8ce4daa6aff5ad7eb0e2b713f74c4
parent54f156968a1ca1655a53b4975e91b767552d8008 (diff)
staging: vc04_services: no need to save the log debufs dentries
The log entry dentries are only set, never referenced, so no need to keep them around. Remove the pointer from struct vchiq_debugfs_log_entry as it is not needed anymore and get rid of the separate vchiq_debugfs_create_log_entries() function as it is only used in one place. 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.c29
1 files changed, 10 insertions, 19 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 2b353d2d25ce..38805504d462 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
@@ -59,7 +59,6 @@ struct dentry *vchiq_dbg_clients;
59struct vchiq_debugfs_log_entry { 59struct vchiq_debugfs_log_entry {
60 const char *name; 60 const char *name;
61 void *plevel; 61 void *plevel;
62 struct dentry *dir;
63}; 62};
64 63
65static struct vchiq_debugfs_log_entry vchiq_debugfs_log_entries[] = { 64static struct vchiq_debugfs_log_entry vchiq_debugfs_log_entries[] = {
@@ -144,23 +143,6 @@ static const struct file_operations debugfs_log_fops = {
144 .release = single_release, 143 .release = single_release,
145}; 144};
146 145
147/* create an entry under <debugfs>/vchiq/log for each log category */
148static void vchiq_debugfs_create_log_entries(struct dentry *top)
149{
150 struct dentry *dir;
151 size_t i;
152
153 dir = debugfs_create_dir("log", vchiq_dbg_dir);
154
155 for (i = 0; i < n_log_entries; i++) {
156 dir = debugfs_create_file(vchiq_debugfs_log_entries[i].name,
157 0644, dir,
158 vchiq_debugfs_log_entries[i].plevel,
159 &debugfs_log_fops);
160 vchiq_debugfs_log_entries[i].dir = dir;
161 }
162}
163
164static int debugfs_usecount_show(struct seq_file *f, void *offset) 146static int debugfs_usecount_show(struct seq_file *f, void *offset)
165{ 147{
166 VCHIQ_INSTANCE_T instance = f->private; 148 VCHIQ_INSTANCE_T instance = f->private;
@@ -268,10 +250,19 @@ void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance)
268 250
269void vchiq_debugfs_init(void) 251void vchiq_debugfs_init(void)
270{ 252{
253 struct dentry *dir;
254 int i;
255
271 vchiq_dbg_dir = debugfs_create_dir("vchiq", NULL); 256 vchiq_dbg_dir = debugfs_create_dir("vchiq", NULL);
272 vchiq_dbg_clients = debugfs_create_dir("clients", vchiq_dbg_dir); 257 vchiq_dbg_clients = debugfs_create_dir("clients", vchiq_dbg_dir);
273 258
274 vchiq_debugfs_create_log_entries(vchiq_dbg_dir); 259 /* create an entry under <debugfs>/vchiq/log for each log category */
260 dir = debugfs_create_dir("log", vchiq_dbg_dir);
261
262 for (i = 0; i < n_log_entries; i++)
263 debugfs_create_file(vchiq_debugfs_log_entries[i].name, 0644,
264 dir, vchiq_debugfs_log_entries[i].plevel,
265 &debugfs_log_fops);
275} 266}
276 267
277/* remove all the debugfs entries */ 268/* remove all the debugfs entries */