Bluetooth: Fix compile warnings in mgmt
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Mon, 18 Jun 2012 10:03:46 +0000 (13:03 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Tue, 19 Jun 2012 02:55:59 +0000 (23:55 -0300)
Commit af7985bf85840e3dc90ba108a679db044f91f00e introduced regression
resulting in complie warnings:

...
net/bluetooth/mgmt.c:3568:27: warning: invalid assignment: |=
net/bluetooth/mgmt.c:3568:27:    left side has type restricted __le32
net/bluetooth/mgmt.c:3568:27:    right side has type int
net/bluetooth/mgmt.c:3570:27: warning: invalid assignment: |=
net/bluetooth/mgmt.c:3570:27:    left side has type restricted __le32
net/bluetooth/mgmt.c:3570:27:    right side has type int
net/bluetooth/mgmt.c:3580:21: warning: cast from restricted __le32
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/mgmt.c

index 5aa5592..eff610d 100644 (file)
@@ -3546,9 +3546,9 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
        ev->addr.type = link_to_bdaddr(link_type, addr_type);
        ev->rssi = rssi;
        if (cfm_name)
-               ev->flags |= MGMT_DEV_FOUND_CONFIRM_NAME;
+               ev->flags |= cpu_to_le32(MGMT_DEV_FOUND_CONFIRM_NAME);
        if (!ssp)
-               ev->flags |= MGMT_DEV_FOUND_LEGACY_PAIRING;
+               ev->flags |= cpu_to_le32(MGMT_DEV_FOUND_LEGACY_PAIRING);
 
        if (eir_len > 0)
                memcpy(ev->eir, eir, eir_len);
@@ -3558,8 +3558,6 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
                                          dev_class, 3);
 
        ev->eir_len = cpu_to_le16(eir_len);
-       ev->flags = cpu_to_le32(ev->flags);
-
        ev_size = sizeof(*ev) + eir_len;
 
        return mgmt_event(MGMT_EV_DEVICE_FOUND, hdev, ev, ev_size, NULL);