aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@nokia.com>2010-11-22 06:21:37 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2010-12-01 18:04:36 -0500
commitcc11b9c14da4ca1c545b424dae2ae8fb1ab04063 (patch)
tree34e7ecf89659bd99f696698ab72833b18b4651dc /net/bluetooth
parent940a9eea80946b64b96bd8af1fc71b30c602d057 (diff)
Bluetooth: do not use assignment in if condition
Fix checkpatch errors like: "ERROR: do not use assignment in if condition" Simplify code and fix one long line. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com> Acked-by: Ville Tervo <ville.tervo@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_event.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 4165895049b3..3c1957c82b61 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -996,12 +996,14 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
996 996
997 hci_dev_lock(hdev); 997 hci_dev_lock(hdev);
998 998
999 if ((ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr))) 999 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr);
1000 if (ie)
1000 memcpy(ie->data.dev_class, ev->dev_class, 3); 1001 memcpy(ie->data.dev_class, ev->dev_class, 3);
1001 1002
1002 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); 1003 conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
1003 if (!conn) { 1004 if (!conn) {
1004 if (!(conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr))) { 1005 conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr);
1006 if (!conn) {
1005 BT_ERR("No memory for new connection"); 1007 BT_ERR("No memory for new connection");
1006 hci_dev_unlock(hdev); 1008 hci_dev_unlock(hdev);
1007 return; 1009 return;
@@ -1608,7 +1610,8 @@ static inline void hci_clock_offset_evt(struct hci_dev *hdev, struct sk_buff *sk
1608 if (conn && !ev->status) { 1610 if (conn && !ev->status) {
1609 struct inquiry_entry *ie; 1611 struct inquiry_entry *ie;
1610 1612
1611 if ((ie = hci_inquiry_cache_lookup(hdev, &conn->dst))) { 1613 ie = hci_inquiry_cache_lookup(hdev, &conn->dst);
1614 if (ie) {
1612 ie->data.clock_offset = ev->clock_offset; 1615 ie->data.clock_offset = ev->clock_offset;
1613 ie->timestamp = jiffies; 1616 ie->timestamp = jiffies;
1614 } 1617 }
@@ -1642,7 +1645,8 @@ static inline void hci_pscan_rep_mode_evt(struct hci_dev *hdev, struct sk_buff *
1642 1645
1643 hci_dev_lock(hdev); 1646 hci_dev_lock(hdev);
1644 1647
1645 if ((ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr))) { 1648 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr);
1649 if (ie) {
1646 ie->data.pscan_rep_mode = ev->pscan_rep_mode; 1650 ie->data.pscan_rep_mode = ev->pscan_rep_mode;
1647 ie->timestamp = jiffies; 1651 ie->timestamp = jiffies;
1648 } 1652 }
@@ -1713,7 +1717,8 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b
1713 if (!ev->status && ev->page == 0x01) { 1717 if (!ev->status && ev->page == 0x01) {
1714 struct inquiry_entry *ie; 1718 struct inquiry_entry *ie;
1715 1719
1716 if ((ie = hci_inquiry_cache_lookup(hdev, &conn->dst))) 1720 ie = hci_inquiry_cache_lookup(hdev, &conn->dst);
1721 if (ie)
1717 ie->data.ssp_mode = (ev->features[0] & 0x01); 1722 ie->data.ssp_mode = (ev->features[0] & 0x01);
1718 1723
1719 conn->ssp_mode = (ev->features[0] & 0x01); 1724 conn->ssp_mode = (ev->features[0] & 0x01);
@@ -1886,7 +1891,8 @@ static inline void hci_remote_host_features_evt(struct hci_dev *hdev, struct sk_
1886 1891
1887 hci_dev_lock(hdev); 1892 hci_dev_lock(hdev);
1888 1893
1889 if ((ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr))) 1894 ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr);
1895 if (ie)
1890 ie->data.ssp_mode = (ev->features[0] & 0x01); 1896 ie->data.ssp_mode = (ev->features[0] & 0x01);
1891 1897
1892 hci_dev_unlock(hdev); 1898 hci_dev_unlock(hdev);