Bluetooth: Remove unnecessary headers include
[firefly-linux-kernel-4.4.55.git] / net / bluetooth / rfcomm / sock.c
index a55a43e9f70e9d35181f1272c3897ac43856a6d9..7e1e59645c056f71400ad9ed4dc0444548c41951 100644 (file)
  * RFCOMM sockets.
  */
 
-#include <linux/module.h>
-
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/poll.h>
-#include <linux/fcntl.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/socket.h>
-#include <linux/skbuff.h>
-#include <linux/list.h>
-#include <linux/device.h>
+#include <linux/export.h>
 #include <linux/debugfs.h>
-#include <linux/seq_file.h>
-#include <linux/security.h>
-#include <net/sock.h>
-
-#include <linux/uaccess.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -260,7 +241,8 @@ static void rfcomm_sock_init(struct sock *sk, struct sock *parent)
 
        if (parent) {
                sk->sk_type = parent->sk_type;
-               pi->dlc->defer_setup = bt_sk(parent)->defer_setup;
+               pi->dlc->defer_setup = test_bit(BT_SK_DEFER_SETUP,
+                                               &bt_sk(parent)->flags);
 
                pi->sec_level = rfcomm_pi(parent)->sec_level;
                pi->role_switch = rfcomm_pi(parent)->role_switch;
@@ -731,7 +713,11 @@ static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, c
                        break;
                }
 
-               bt_sk(sk)->defer_setup = opt;
+               if (opt)
+                       set_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
+               else
+                       clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
+
                break;
 
        default:
@@ -849,7 +835,8 @@ static int rfcomm_sock_getsockopt(struct socket *sock, int level, int optname, c
                        break;
                }
 
-               if (put_user(bt_sk(sk)->defer_setup, (u32 __user *) optval))
+               if (put_user(test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags),
+                            (u32 __user *) optval))
                        err = -EFAULT;
 
                break;
@@ -972,7 +959,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *
 done:
        bh_unlock_sock(parent);
 
-       if (bt_sk(parent)->defer_setup)
+       if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags))
                parent->sk_state_change(parent);
 
        return result;