summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hidp/core.c
diff options
context:
space:
mode:
authorGustavo F. Padovan2011-10-06 22:35:31 +0200
committerGustavo F. Padovan2011-10-07 03:15:49 +0200
commitcd11cdd28468d6222ce6489b2212fa7b0efaefdf (patch)
treea28addaebd7b1182a73a9d282dfe5f8a6681d992 /net/bluetooth/hidp/core.c
parentBluetooth: hidp: Stop I/O on shutdown (diff)
downloadkernel-qcow2-linux-cd11cdd28468d6222ce6489b2212fa7b0efaefdf.tar.gz
kernel-qcow2-linux-cd11cdd28468d6222ce6489b2212fa7b0efaefdf.tar.xz
kernel-qcow2-linux-cd11cdd28468d6222ce6489b2212fa7b0efaefdf.zip
Bluetooth: use list_for_each_entry() in hidp
list_for_each_entry is much more meaningful. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hidp/core.c')
-rw-r--r--net/bluetooth/hidp/core.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index d7bae2be83b2..08bfbb0f0926 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -81,12 +81,10 @@ static unsigned char hidp_mkeyspat[] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
static struct hidp_session *__hidp_get_session(bdaddr_t *bdaddr)
{
struct hidp_session *session;
- struct list_head *p;
BT_DBG("");
- list_for_each(p, &hidp_session_list) {
- session = list_entry(p, struct hidp_session, list);
+ list_for_each_entry(session, &hidp_session_list, list) {
if (!bacmp(bdaddr, &session->bdaddr))
return session;
}
@@ -1140,19 +1138,16 @@ int hidp_del_connection(struct hidp_conndel_req *req)
int hidp_get_connlist(struct hidp_connlist_req *req)
{
- struct list_head *p;
+ struct hidp_session *session;
int err = 0, n = 0;
BT_DBG("");
down_read(&hidp_session_sem);
- list_for_each(p, &hidp_session_list) {
- struct hidp_session *session;
+ list_for_each_entry(session, &hidp_session_list, list) {
struct hidp_conninfo ci;
- session = list_entry(p, struct hidp_session, list);
-
__hidp_copy_session(session, &ci);
if (copy_to_user(req->ci, &ci, sizeof(ci))) {