]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/bluetooth/hci_conn.c
Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / net / bluetooth / hci_conn.c
index 0b1e460fe440cfb07a86c0a15e87b7e98c03ba0f..6b90a41917347826f2a81fea590124a54af1f9bd 100644 (file)
@@ -39,7 +39,7 @@
 #include <net/sock.h>
 
 #include <asm/system.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <asm/unaligned.h>
 
 #include <net/bluetooth/bluetooth.h>
@@ -66,7 +66,8 @@ void hci_acl_connect(struct hci_conn *conn)
        bacpy(&cp.bdaddr, &conn->dst);
        cp.pscan_rep_mode = 0x02;
 
-       if ((ie = hci_inquiry_cache_lookup(hdev, &conn->dst))) {
+       ie = hci_inquiry_cache_lookup(hdev, &conn->dst);
+       if (ie) {
                if (inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) {
                        cp.pscan_rep_mode = ie->data.pscan_rep_mode;
                        cp.pscan_mode     = ie->data.pscan_mode;
@@ -368,8 +369,10 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
 
        BT_DBG("%s dst %s", hdev->name, batostr(dst));
 
-       if (!(acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst))) {
-               if (!(acl = hci_conn_add(hdev, ACL_LINK, dst)))
+       acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst);
+       if (!acl) {
+               acl = hci_conn_add(hdev, ACL_LINK, dst);
+               if (!acl)
                        return NULL;
        }
 
@@ -389,8 +392,10 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
        if (type == ACL_LINK)
                return acl;
 
-       if (!(sco = hci_conn_hash_lookup_ba(hdev, type, dst))) {
-               if (!(sco = hci_conn_add(hdev, type, dst))) {
+       sco = hci_conn_hash_lookup_ba(hdev, type, dst);
+       if (!sco) {
+               sco = hci_conn_add(hdev, type, dst);
+               if (!sco) {
                        hci_conn_put(acl);
                        return NULL;
                }
@@ -647,10 +652,12 @@ int hci_get_conn_list(void __user *arg)
 
        size = sizeof(req) + req.conn_num * sizeof(*ci);
 
-       if (!(cl = kmalloc(size, GFP_KERNEL)))
+       cl = kmalloc(size, GFP_KERNEL);
+       if (!cl)
                return -ENOMEM;
 
-       if (!(hdev = hci_dev_get(req.dev_id))) {
+       hdev = hci_dev_get(req.dev_id);
+       if (!hdev) {
                kfree(cl);
                return -ENODEV;
        }