KVM: PPC: Book3S HV: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
This commit is contained in:
Yangtao Li 2018-11-05 09:47:17 -05:00 committed by Paul Mackerras
parent 234ff0b729
commit 0f6ddf34be
2 changed files with 2 additions and 22 deletions

View File

@ -1015,17 +1015,7 @@ static int xics_debug_show(struct seq_file *m, void *private)
return 0; return 0;
} }
static int xics_debug_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(xics_debug);
{
return single_open(file, xics_debug_show, inode->i_private);
}
static const struct file_operations xics_debug_fops = {
.open = xics_debug_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static void xics_debugfs_init(struct kvmppc_xics *xics) static void xics_debugfs_init(struct kvmppc_xics *xics)
{ {

View File

@ -1968,17 +1968,7 @@ static int xive_debug_show(struct seq_file *m, void *private)
return 0; return 0;
} }
static int xive_debug_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(xive_debug);
{
return single_open(file, xive_debug_show, inode->i_private);
}
static const struct file_operations xive_debug_fops = {
.open = xive_debug_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static void xive_debugfs_init(struct kvmppc_xive *xive) static void xive_debugfs_init(struct kvmppc_xive *xive)
{ {