Skip to content

Commit c13e0a5

Browse files
TinyWindzzgregkh
authored andcommitted
binder: remove BINDER_DEBUG_ENTRY()
We already have the DEFINE_SHOW_ATTRIBUTE.There is no need to define such a macro,so remove BINDER_DEBUG_ENTRY. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Acked-by: Todd Kjos <tkjos@android.com> Reviewed-by: Joey Pabalinas <joeypabalinas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f8a70d8 commit c13e0a5

File tree

1 file changed

+17
-31
lines changed

1 file changed

+17
-31
lines changed

drivers/android/binder.c

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,8 @@ static struct dentry *binder_debugfs_dir_entry_root;
9494
static struct dentry *binder_debugfs_dir_entry_proc;
9595
static atomic_t binder_last_id;
9696

97-
#define BINDER_DEBUG_ENTRY(name) \
98-
static int binder_##name##_open(struct inode *inode, struct file *file) \
99-
{ \
100-
return single_open(file, binder_##name##_show, inode->i_private); \
101-
} \
102-
\
103-
static const struct file_operations binder_##name##_fops = { \
104-
.owner = THIS_MODULE, \
105-
.open = binder_##name##_open, \
106-
.read = seq_read, \
107-
.llseek = seq_lseek, \
108-
.release = single_release, \
109-
}
110-
111-
static int binder_proc_show(struct seq_file *m, void *unused);
112-
BINDER_DEBUG_ENTRY(proc);
97+
static int proc_show(struct seq_file *m, void *unused);
98+
DEFINE_SHOW_ATTRIBUTE(proc);
11399

114100
/* This is only defined in include/asm-arm/sizes.h */
115101
#ifndef SZ_1K
@@ -5008,7 +4994,7 @@ static int binder_open(struct inode *nodp, struct file *filp)
50084994
proc->debugfs_entry = debugfs_create_file(strbuf, 0444,
50094995
binder_debugfs_dir_entry_proc,
50104996
(void *)(unsigned long)proc->pid,
5011-
&binder_proc_fops);
4997+
&proc_fops);
50124998
}
50134999

50145000
return 0;
@@ -5636,7 +5622,7 @@ static void print_binder_proc_stats(struct seq_file *m,
56365622
}
56375623

56385624

5639-
static int binder_state_show(struct seq_file *m, void *unused)
5625+
static int state_show(struct seq_file *m, void *unused)
56405626
{
56415627
struct binder_proc *proc;
56425628
struct binder_node *node;
@@ -5675,7 +5661,7 @@ static int binder_state_show(struct seq_file *m, void *unused)
56755661
return 0;
56765662
}
56775663

5678-
static int binder_stats_show(struct seq_file *m, void *unused)
5664+
static int stats_show(struct seq_file *m, void *unused)
56795665
{
56805666
struct binder_proc *proc;
56815667

@@ -5691,7 +5677,7 @@ static int binder_stats_show(struct seq_file *m, void *unused)
56915677
return 0;
56925678
}
56935679

5694-
static int binder_transactions_show(struct seq_file *m, void *unused)
5680+
static int transactions_show(struct seq_file *m, void *unused)
56955681
{
56965682
struct binder_proc *proc;
56975683

@@ -5704,7 +5690,7 @@ static int binder_transactions_show(struct seq_file *m, void *unused)
57045690
return 0;
57055691
}
57065692

5707-
static int binder_proc_show(struct seq_file *m, void *unused)
5693+
static int proc_show(struct seq_file *m, void *unused)
57085694
{
57095695
struct binder_proc *itr;
57105696
int pid = (unsigned long)m->private;
@@ -5747,7 +5733,7 @@ static void print_binder_transaction_log_entry(struct seq_file *m,
57475733
"\n" : " (incomplete)\n");
57485734
}
57495735

5750-
static int binder_transaction_log_show(struct seq_file *m, void *unused)
5736+
static int transaction_log_show(struct seq_file *m, void *unused)
57515737
{
57525738
struct binder_transaction_log *log = m->private;
57535739
unsigned int log_cur = atomic_read(&log->cur);
@@ -5779,10 +5765,10 @@ static const struct file_operations binder_fops = {
57795765
.release = binder_release,
57805766
};
57815767

5782-
BINDER_DEBUG_ENTRY(state);
5783-
BINDER_DEBUG_ENTRY(stats);
5784-
BINDER_DEBUG_ENTRY(transactions);
5785-
BINDER_DEBUG_ENTRY(transaction_log);
5768+
DEFINE_SHOW_ATTRIBUTE(state);
5769+
DEFINE_SHOW_ATTRIBUTE(stats);
5770+
DEFINE_SHOW_ATTRIBUTE(transactions);
5771+
DEFINE_SHOW_ATTRIBUTE(transaction_log);
57865772

57875773
static int __init init_binder_device(const char *name)
57885774
{
@@ -5836,27 +5822,27 @@ static int __init binder_init(void)
58365822
0444,
58375823
binder_debugfs_dir_entry_root,
58385824
NULL,
5839-
&binder_state_fops);
5825+
&state_fops);
58405826
debugfs_create_file("stats",
58415827
0444,
58425828
binder_debugfs_dir_entry_root,
58435829
NULL,
5844-
&binder_stats_fops);
5830+
&stats_fops);
58455831
debugfs_create_file("transactions",
58465832
0444,
58475833
binder_debugfs_dir_entry_root,
58485834
NULL,
5849-
&binder_transactions_fops);
5835+
&transactions_fops);
58505836
debugfs_create_file("transaction_log",
58515837
0444,
58525838
binder_debugfs_dir_entry_root,
58535839
&binder_transaction_log,
5854-
&binder_transaction_log_fops);
5840+
&transaction_log_fops);
58555841
debugfs_create_file("failed_transaction_log",
58565842
0444,
58575843
binder_debugfs_dir_entry_root,
58585844
&binder_transaction_log_failed,
5859-
&binder_transaction_log_fops);
5845+
&transaction_log_fops);
58605846
}
58615847

58625848
/*

0 commit comments

Comments
 (0)