1 From 4940fd338dc53324603c0bd2642b0a3864baa5fe Mon Sep 17 00:00:00 2001
2 From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 Date: Fri, 1 Jun 2018 13:10:04 +0200
4 Subject: [PATCH 386/454] staging: vc04_services: no need to save the log
7 commit 3b93c0f4b6accb8105152900d7e414593a8b0c79 upstream
9 The log entry dentries are only set, never referenced, so no need to
10 keep them around. Remove the pointer from struct
11 vchiq_debugfs_log_entry as it is not needed anymore and get rid of the
12 separate vchiq_debugfs_create_log_entries() function as it is only used
15 Suggested-by: Eric Anholt <eric@anholt.net>
16 Cc: Stefan Wahren <stefan.wahren@i2se.com>
17 Cc: Kees Cook <keescook@chromium.org>
18 Cc: Dan Carpenter <dan.carpenter@oracle.com>
19 Cc: Arnd Bergmann <arnd@arndb.de>
20 Cc: Keerthi Reddy <keerthigd4990@gmail.com>
21 Cc: linux-rpi-kernel@lists.infradead.org
22 Cc: linux-arm-kernel@lists.infradead.org
23 Reviewed-by: Eric Anholt <eric@anholt.net>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 .../interface/vchiq_arm/vchiq_debugfs.c | 29 +++++++------------
27 1 file changed, 10 insertions(+), 19 deletions(-)
29 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
30 +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
31 @@ -60,7 +60,6 @@ struct dentry *vchiq_dbg_clients;
32 struct vchiq_debugfs_log_entry {
38 static struct vchiq_debugfs_log_entry vchiq_debugfs_log_entries[] = {
39 @@ -145,23 +144,6 @@ static const struct file_operations debu
40 .release = single_release,
43 -/* create an entry under <debugfs>/vchiq/log for each log category */
44 -static void vchiq_debugfs_create_log_entries(struct dentry *top)
49 - dir = debugfs_create_dir("log", vchiq_dbg_dir);
51 - for (i = 0; i < n_log_entries; i++) {
52 - dir = debugfs_create_file(vchiq_debugfs_log_entries[i].name,
54 - vchiq_debugfs_log_entries[i].plevel,
56 - vchiq_debugfs_log_entries[i].dir = dir;
60 static int debugfs_usecount_show(struct seq_file *f, void *offset)
62 VCHIQ_INSTANCE_T instance = f->private;
63 @@ -269,10 +251,19 @@ void vchiq_debugfs_remove_instance(VCHIQ
65 void vchiq_debugfs_init(void)
70 vchiq_dbg_dir = debugfs_create_dir("vchiq", NULL);
71 vchiq_dbg_clients = debugfs_create_dir("clients", vchiq_dbg_dir);
73 - vchiq_debugfs_create_log_entries(vchiq_dbg_dir);
74 + /* create an entry under <debugfs>/vchiq/log for each log category */
75 + dir = debugfs_create_dir("log", vchiq_dbg_dir);
77 + for (i = 0; i < n_log_entries; i++)
78 + debugfs_create_file(vchiq_debugfs_log_entries[i].name, 0644,
79 + dir, vchiq_debugfs_log_entries[i].plevel,
83 /* remove all the debugfs entries */