Commit 711584ea authored by Denis Kirjanov's avatar Denis Kirjanov Committed by Gustavo Padovan

Bluetooth:Replace list_for_each with list_for_each_entry() helper

Replace list_for_each with list_for_each_entry() helper
Signed-off-by: default avatarDenis Kirjanov <kirjanov@gmail.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent 4611dfa8
...@@ -880,7 +880,7 @@ struct hci_cb { ...@@ -880,7 +880,7 @@ struct hci_cb {
static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
{ {
struct list_head *p; struct hci_cb *cb;
__u8 encrypt; __u8 encrypt;
hci_proto_auth_cfm(conn, status); hci_proto_auth_cfm(conn, status);
...@@ -891,8 +891,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) ...@@ -891,8 +891,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00;
read_lock(&hci_cb_list_lock); read_lock(&hci_cb_list_lock);
list_for_each(p, &hci_cb_list) { list_for_each_entry(cb, &hci_cb_list, list) {
struct hci_cb *cb = list_entry(p, struct hci_cb, list);
if (cb->security_cfm) if (cb->security_cfm)
cb->security_cfm(conn, status, encrypt); cb->security_cfm(conn, status, encrypt);
} }
...@@ -902,7 +901,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) ...@@ -902,7 +901,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
__u8 encrypt) __u8 encrypt)
{ {
struct list_head *p; struct hci_cb *cb;
if (conn->sec_level == BT_SECURITY_SDP) if (conn->sec_level == BT_SECURITY_SDP)
conn->sec_level = BT_SECURITY_LOW; conn->sec_level = BT_SECURITY_LOW;
...@@ -913,8 +912,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, ...@@ -913,8 +912,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
hci_proto_encrypt_cfm(conn, status, encrypt); hci_proto_encrypt_cfm(conn, status, encrypt);
read_lock(&hci_cb_list_lock); read_lock(&hci_cb_list_lock);
list_for_each(p, &hci_cb_list) { list_for_each_entry(cb, &hci_cb_list, list) {
struct hci_cb *cb = list_entry(p, struct hci_cb, list);
if (cb->security_cfm) if (cb->security_cfm)
cb->security_cfm(conn, status, encrypt); cb->security_cfm(conn, status, encrypt);
} }
...@@ -923,11 +921,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, ...@@ -923,11 +921,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
{ {
struct list_head *p; struct hci_cb *cb;
read_lock(&hci_cb_list_lock); read_lock(&hci_cb_list_lock);
list_for_each(p, &hci_cb_list) { list_for_each_entry(cb, &hci_cb_list, list) {
struct hci_cb *cb = list_entry(p, struct hci_cb, list);
if (cb->key_change_cfm) if (cb->key_change_cfm)
cb->key_change_cfm(conn, status); cb->key_change_cfm(conn, status);
} }
...@@ -937,11 +934,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) ...@@ -937,11 +934,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
__u8 role) __u8 role)
{ {
struct list_head *p; struct hci_cb *cb;
read_lock(&hci_cb_list_lock); read_lock(&hci_cb_list_lock);
list_for_each(p, &hci_cb_list) { list_for_each_entry(cb, &hci_cb_list, list) {
struct hci_cb *cb = list_entry(p, struct hci_cb, list);
if (cb->role_switch_cfm) if (cb->role_switch_cfm)
cb->role_switch_cfm(conn, status, role); cb->role_switch_cfm(conn, status, role);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment