Commit c13e0a52 authored by Yangtao Li's avatar Yangtao Li Committed by Greg Kroah-Hartman
Browse files

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: default avatarYangtao Li <tiny.windzz@gmail.com>
Acked-by: default avatarTodd Kjos <tkjos@android.com>
Reviewed-by: default avatarJoey Pabalinas <joeypabalinas@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f8a70d8b
Loading
Loading
Loading
Loading
+17 −31
Original line number Diff line number Diff line
@@ -94,22 +94,8 @@ static struct dentry *binder_debugfs_dir_entry_root;
static struct dentry *binder_debugfs_dir_entry_proc;
static atomic_t binder_last_id;

#define BINDER_DEBUG_ENTRY(name) \
static int binder_##name##_open(struct inode *inode, struct file *file) \
{ \
	return single_open(file, binder_##name##_show, inode->i_private); \
} \
\
static const struct file_operations binder_##name##_fops = { \
	.owner = THIS_MODULE, \
	.open = binder_##name##_open, \
	.read = seq_read, \
	.llseek = seq_lseek, \
	.release = single_release, \
}

static int binder_proc_show(struct seq_file *m, void *unused);
BINDER_DEBUG_ENTRY(proc);
static int proc_show(struct seq_file *m, void *unused);
DEFINE_SHOW_ATTRIBUTE(proc);

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

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


static int binder_state_show(struct seq_file *m, void *unused)
static int state_show(struct seq_file *m, void *unused)
{
	struct binder_proc *proc;
	struct binder_node *node;
@@ -5675,7 +5661,7 @@ static int binder_state_show(struct seq_file *m, void *unused)
	return 0;
}

static int binder_stats_show(struct seq_file *m, void *unused)
static int stats_show(struct seq_file *m, void *unused)
{
	struct binder_proc *proc;

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

static int binder_transactions_show(struct seq_file *m, void *unused)
static int transactions_show(struct seq_file *m, void *unused)
{
	struct binder_proc *proc;

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

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

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

BINDER_DEBUG_ENTRY(state);
BINDER_DEBUG_ENTRY(stats);
BINDER_DEBUG_ENTRY(transactions);
BINDER_DEBUG_ENTRY(transaction_log);
DEFINE_SHOW_ATTRIBUTE(state);
DEFINE_SHOW_ATTRIBUTE(stats);
DEFINE_SHOW_ATTRIBUTE(transactions);
DEFINE_SHOW_ATTRIBUTE(transaction_log);

static int __init init_binder_device(const char *name)
{
@@ -5836,27 +5822,27 @@ static int __init binder_init(void)
				    0444,
				    binder_debugfs_dir_entry_root,
				    NULL,
				    &binder_state_fops);
				    &state_fops);
		debugfs_create_file("stats",
				    0444,
				    binder_debugfs_dir_entry_root,
				    NULL,
				    &binder_stats_fops);
				    &stats_fops);
		debugfs_create_file("transactions",
				    0444,
				    binder_debugfs_dir_entry_root,
				    NULL,
				    &binder_transactions_fops);
				    &transactions_fops);
		debugfs_create_file("transaction_log",
				    0444,
				    binder_debugfs_dir_entry_root,
				    &binder_transaction_log,
				    &binder_transaction_log_fops);
				    &transaction_log_fops);
		debugfs_create_file("failed_transaction_log",
				    0444,
				    binder_debugfs_dir_entry_root,
				    &binder_transaction_log_failed,
				    &binder_transaction_log_fops);
				    &transaction_log_fops);
	}

	/*