]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/bluetooth/mgmt.c
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
[karo-tx-linux.git] / net / bluetooth / mgmt.c
index e6efaae764b38fd2c81826516061ad0f3ec6dc9d..0054c74e27b7fcd4971477408721b003e773f37a 100644 (file)
@@ -716,8 +716,7 @@ static int set_service_cache(struct sock *sk, u16 index,  unsigned char *data,
        cp = (void *) data;
 
        if (len != sizeof(*cp))
-               return cmd_status(sk, index, MGMT_OP_SET_SERVICE_CACHE,
-                                                                       EINVAL);
+               return cmd_status(sk, index, MGMT_OP_SET_SERVICE_CACHE, EINVAL);
 
        hdev = hci_dev_get(index);
        if (!hdev)
@@ -900,10 +899,8 @@ failed:
        return err;
 }
 
-static int get_connections(struct sock *sk, u16 index, unsigned char *data,
-                                                                       u16 len)
+static int get_connections(struct sock *sk, u16 index)
 {
-       struct mgmt_cp_get_connections *cp;
        struct mgmt_rp_get_connections *rp;
        struct hci_dev *hdev;
        struct list_head *p;
@@ -913,8 +910,6 @@ static int get_connections(struct sock *sk, u16 index, unsigned char *data,
 
        BT_DBG("");
 
-       cp = (void *) data;
-
        hdev = hci_dev_get(index);
        if (!hdev)
                return cmd_status(sk, index, MGMT_OP_GET_CONNECTIONS, ENODEV);
@@ -1039,7 +1034,7 @@ static int pin_code_neg_reply(struct sock *sk, u16 index, unsigned char *data,
                goto failed;
        }
 
-       err = hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, sizeof(bdaddr_t),
+       err = hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, sizeof(cp->bdaddr),
                                                                &cp->bdaddr);
        if (err < 0)
                mgmt_pending_remove(cmd);
@@ -1062,8 +1057,7 @@ static int set_io_capability(struct sock *sk, u16 index, unsigned char *data,
        cp = (void *) data;
 
        if (len != sizeof(*cp))
-               return cmd_status(sk, index, MGMT_OP_SET_IO_CAPABILITY,
-                                                                       EINVAL);
+               return cmd_status(sk, index, MGMT_OP_SET_IO_CAPABILITY, EINVAL);
 
        hdev = hci_dev_get(index);
        if (!hdev)
@@ -1074,7 +1068,7 @@ static int set_io_capability(struct sock *sk, u16 index, unsigned char *data,
        hdev->io_capability = cp->io_capability;
 
        BT_DBG("%s IO capability set to 0x%02x", hdev->name,
-                                               hdev->io_capability);
+                                                       hdev->io_capability);
 
        hci_dev_unlock_bh(hdev);
        hci_dev_put(hdev);
@@ -1333,7 +1327,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
                err = disconnect(sk, index, buf + sizeof(*hdr), len);
                break;
        case MGMT_OP_GET_CONNECTIONS:
-               err = get_connections(sk, index, buf + sizeof(*hdr), len);
+               err = get_connections(sk, index);
                break;
        case MGMT_OP_PIN_CODE_REPLY:
                err = pin_code_reply(sk, index, buf + sizeof(*hdr), len);
@@ -1428,8 +1422,7 @@ int mgmt_discoverable(u16 index, u8 discoverable)
        struct cmd_lookup match = { discoverable, NULL };
        int ret;
 
-       mgmt_pending_foreach(MGMT_OP_SET_DISCOVERABLE, index,
-                                                       mode_rsp, &match);
+       mgmt_pending_foreach(MGMT_OP_SET_DISCOVERABLE, index, mode_rsp, &match);
 
        ev.val = discoverable;
 
@@ -1635,8 +1628,7 @@ int mgmt_user_confirm_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status)
                                                MGMT_OP_USER_CONFIRM_REPLY);
 }
 
-int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr,
-                                                               u8 status)
+int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status)
 {
        return confirm_reply_complete(index, bdaddr, status,
                                        MGMT_OP_USER_CONFIRM_NEG_REPLY);