]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: Change to use DEFINE_SHOW_ATTRIBUTE macro
authorYangtao Li <tiny.windzz@gmail.com>
Mon, 5 Nov 2018 14:56:19 +0000 (09:56 -0500)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 18 Dec 2018 23:28:20 +0000 (00:28 +0100)
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap_core.c
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/sock.c
net/bluetooth/sco.c

index 2146e0f3b6f868dc032fbbd741af55a7956a23bc..2a7fb517d460f02db1b5a901899ff42f9d193e1b 100644 (file)
@@ -7650,17 +7650,7 @@ static int l2cap_debugfs_show(struct seq_file *f, void *p)
        return 0;
 }
 
-static int l2cap_debugfs_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, l2cap_debugfs_show, inode->i_private);
-}
-
-static const struct file_operations l2cap_debugfs_fops = {
-       .open           = l2cap_debugfs_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(l2cap_debugfs);
 
 static struct dentry *l2cap_debugfs;
 
index b98225d65e87a34de2773c41a29ffc15a19db471..1a635df80643707b31a4db2b7f3ef5953bc4b4fc 100644 (file)
@@ -2166,17 +2166,7 @@ static int rfcomm_dlc_debugfs_show(struct seq_file *f, void *x)
        return 0;
 }
 
-static int rfcomm_dlc_debugfs_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, rfcomm_dlc_debugfs_show, inode->i_private);
-}
-
-static const struct file_operations rfcomm_dlc_debugfs_fops = {
-       .open           = rfcomm_dlc_debugfs_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(rfcomm_dlc_debugfs);
 
 static struct dentry *rfcomm_dlc_debugfs;
 
index d606e9212291608ea2e266238c0f65ce18d0c311..aa0db1d1bd9b4132963d1b78459426bfba300f76 100644 (file)
@@ -1020,17 +1020,7 @@ static int rfcomm_sock_debugfs_show(struct seq_file *f, void *p)
        return 0;
 }
 
-static int rfcomm_sock_debugfs_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, rfcomm_sock_debugfs_show, inode->i_private);
-}
-
-static const struct file_operations rfcomm_sock_debugfs_fops = {
-       .open           = rfcomm_sock_debugfs_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(rfcomm_sock_debugfs);
 
 static struct dentry *rfcomm_sock_debugfs;
 
index 8f0f9279eac9f72c0c15258edabbcbec6d3bf2b6..529b38996d8bce4a657e8b4e15d2140b4a6c1cda 100644 (file)
@@ -1173,17 +1173,7 @@ static int sco_debugfs_show(struct seq_file *f, void *p)
        return 0;
 }
 
-static int sco_debugfs_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, sco_debugfs_show, inode->i_private);
-}
-
-static const struct file_operations sco_debugfs_fops = {
-       .open           = sco_debugfs_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(sco_debugfs);
 
 static struct dentry *sco_debugfs;