aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDenis Kirjanov <kirjanov@gmail.com>2012-10-22 09:22:01 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-11-01 18:26:43 -0400
commit711584ea4c8ce47045c8ed4da3d6c6fdf513db92 (patch)
treeb8970868d68153825bcca127f4c122a89d47d790 /include
parent4611dfa85ece8a26ff46b099a6d91df733066c73 (diff)
Bluetooth:Replace list_for_each with list_for_each_entry() helper
Replace list_for_each with list_for_each_entry() helper Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/hci_core.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 5ab80b7e8369..c885e545e651 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -880,7 +880,7 @@ struct hci_cb {
880 880
881static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) 881static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
882{ 882{
883 struct list_head *p; 883 struct hci_cb *cb;
884 __u8 encrypt; 884 __u8 encrypt;
885 885
886 hci_proto_auth_cfm(conn, status); 886 hci_proto_auth_cfm(conn, status);
@@ -891,8 +891,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
891 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; 891 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00;
892 892
893 read_lock(&hci_cb_list_lock); 893 read_lock(&hci_cb_list_lock);
894 list_for_each(p, &hci_cb_list) { 894 list_for_each_entry(cb, &hci_cb_list, list) {
895 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
896 if (cb->security_cfm) 895 if (cb->security_cfm)
897 cb->security_cfm(conn, status, encrypt); 896 cb->security_cfm(conn, status, encrypt);
898 } 897 }
@@ -902,7 +901,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
902static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, 901static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
903 __u8 encrypt) 902 __u8 encrypt)
904{ 903{
905 struct list_head *p; 904 struct hci_cb *cb;
906 905
907 if (conn->sec_level == BT_SECURITY_SDP) 906 if (conn->sec_level == BT_SECURITY_SDP)
908 conn->sec_level = BT_SECURITY_LOW; 907 conn->sec_level = BT_SECURITY_LOW;
@@ -913,8 +912,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
913 hci_proto_encrypt_cfm(conn, status, encrypt); 912 hci_proto_encrypt_cfm(conn, status, encrypt);
914 913
915 read_lock(&hci_cb_list_lock); 914 read_lock(&hci_cb_list_lock);
916 list_for_each(p, &hci_cb_list) { 915 list_for_each_entry(cb, &hci_cb_list, list) {
917 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
918 if (cb->security_cfm) 916 if (cb->security_cfm)
919 cb->security_cfm(conn, status, encrypt); 917 cb->security_cfm(conn, status, encrypt);
920 } 918 }
@@ -923,11 +921,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
923 921
924static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) 922static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
925{ 923{
926 struct list_head *p; 924 struct hci_cb *cb;
927 925
928 read_lock(&hci_cb_list_lock); 926 read_lock(&hci_cb_list_lock);
929 list_for_each(p, &hci_cb_list) { 927 list_for_each_entry(cb, &hci_cb_list, list) {
930 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
931 if (cb->key_change_cfm) 928 if (cb->key_change_cfm)
932 cb->key_change_cfm(conn, status); 929 cb->key_change_cfm(conn, status);
933 } 930 }
@@ -937,11 +934,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
937static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, 934static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
938 __u8 role) 935 __u8 role)
939{ 936{
940 struct list_head *p; 937 struct hci_cb *cb;
941 938
942 read_lock(&hci_cb_list_lock); 939 read_lock(&hci_cb_list_lock);
943 list_for_each(p, &hci_cb_list) { 940 list_for_each_entry(cb, &hci_cb_list, list) {
944 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
945 if (cb->role_switch_cfm) 941 if (cb->role_switch_cfm)
946 cb->role_switch_cfm(conn, status, role); 942 cb->role_switch_cfm(conn, status, role);
947 } 943 }