14abfcad3c8a24fa10b3323094822c8c6e3ae89c
[openwrt/staging/chunkeey.git] /
1 From 217f7a22c049f2ccc24d2080cf7369f39fe3b6c5 Mon Sep 17 00:00:00 2001
2 From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 Date: Fri, 1 Jun 2018 13:10:01 +0200
4 Subject: [PATCH 383/454] staging: vc04_services: move client dbg directory
5 into static variable
6
7 commit 24e8d3fc42f25936ff270e404847a3a462c38468 upstream
8
9 This does not need to be part of a wrapper function, or in a structure,
10 just properly reference it directly as a single variable.
11
12 The whole variable will be going away soon anyway, this is just a step
13 toward that direction.
14
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>
25 ---
26 .../interface/vchiq_arm/vchiq_debugfs.c | 18 ++++--------------
27 1 file changed, 4 insertions(+), 14 deletions(-)
28
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 @@ -55,17 +55,15 @@
32
33 /* Top-level debug info */
34 struct vchiq_debugfs_info {
35 - /* one entry per client process */
36 - struct dentry *clients;
37 -
38 /* log categories */
39 struct dentry *log_categories;
40 };
41
42 static struct vchiq_debugfs_info debugfs_info;
43
44 -/* Global 'vchiq' debugfs entry used by all instances */
45 +/* Global 'vchiq' debugfs and clients entry used by all instances */
46 struct dentry *vchiq_dbg_dir;
47 +struct dentry *vchiq_dbg_clients;
48
49 /* Log category debugfs entries */
50 struct vchiq_debugfs_log_entry {
51 @@ -83,8 +81,6 @@ static struct vchiq_debugfs_log_entry vc
52 };
53 static int n_log_entries = ARRAY_SIZE(vchiq_debugfs_log_entries);
54
55 -static struct dentry *vchiq_clients_top(void);
56 -
57 static int debugfs_log_show(struct seq_file *f, void *offset)
58 {
59 int *levp = f->private;
60 @@ -264,12 +260,11 @@ void vchiq_debugfs_add_instance(VCHIQ_IN
61 {
62 char pidstr[16];
63 struct dentry *top;
64 - struct dentry *clients = vchiq_clients_top();
65
66 snprintf(pidstr, sizeof(pidstr), "%d",
67 vchiq_instance_get_pid(instance));
68
69 - top = debugfs_create_dir(pidstr, clients);
70 + top = debugfs_create_dir(pidstr, vchiq_dbg_clients);
71
72 debugfs_create_file("use_count", 0444, top, instance,
73 &debugfs_usecount_fops);
74 @@ -288,7 +283,7 @@ void vchiq_debugfs_remove_instance(VCHIQ
75 void vchiq_debugfs_init(void)
76 {
77 vchiq_dbg_dir = debugfs_create_dir("vchiq", NULL);
78 - debugfs_info.clients = debugfs_create_dir("clients", vchiq_dbg_dir);
79 + vchiq_dbg_clients = debugfs_create_dir("clients", vchiq_dbg_dir);
80
81 vchiq_debugfs_create_log_entries(vchiq_dbg_dir);
82 }
83 @@ -299,11 +294,6 @@ void vchiq_debugfs_deinit(void)
84 debugfs_remove_recursive(vchiq_dbg_dir);
85 }
86
87 -static struct dentry *vchiq_clients_top(void)
88 -{
89 - return debugfs_info.clients;
90 -}
91 -
92 #else /* CONFIG_DEBUG_FS */
93
94 void vchiq_debugfs_init(void)