KVM: PPC: Book3S HV: Change to use DEFINE_SHOW_ATTRIBUTE macro
authorYangtao Li <tiny.windzz@gmail.com>
Mon, 5 Nov 2018 14:47:17 +0000 (09:47 -0500)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 14 Dec 2018 04:39:47 +0000 (15:39 +1100)
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>
arch/powerpc/kvm/book3s_xics.c
arch/powerpc/kvm/book3s_xive.c

index b0b2bfc2ff51f4915370445908a07c06ec6342ca..f27ee57ab46ef1c4e6edc478d7b44fe0ffafd80a 100644 (file)
@@ -1015,17 +1015,7 @@ static int xics_debug_show(struct seq_file *m, void *private)
        return 0;
 }
 
-static int xics_debug_open(struct inode *inode, struct file *file)
-{
-       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,
-};
+DEFINE_SHOW_ATTRIBUTE(xics_debug);
 
 static void xics_debugfs_init(struct kvmppc_xics *xics)
 {
index ad4a370703d347b060b89a458d1d4b35e87ca5bd..f78d002f0fe0dce6cc311ae1322dc17c42b7bdd5 100644 (file)
@@ -1968,17 +1968,7 @@ static int xive_debug_show(struct seq_file *m, void *private)
        return 0;
 }
 
-static int xive_debug_open(struct inode *inode, struct file *file)
-{
-       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,
-};
+DEFINE_SHOW_ATTRIBUTE(xive_debug);
 
 static void xive_debugfs_init(struct kvmppc_xive *xive)
 {