summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohan Hedberg2012-01-03 15:03:00 +0100
committerJohan Hedberg2012-02-13 16:01:19 +0100
commitb57c1a5646739bfc273245dc738f2f12a2d4d3ec (patch)
tree1311c1e412bceb3dc53487c3a71365a976c2ce39 /include/net
parentrtlwifi: Modify rtl_pci_init to return 0 on success (diff)
downloadkernel-qcow2-linux-b57c1a5646739bfc273245dc738f2f12a2d4d3ec.tar.gz
kernel-qcow2-linux-b57c1a5646739bfc273245dc738f2f12a2d4d3ec.tar.xz
kernel-qcow2-linux-b57c1a5646739bfc273245dc738f2f12a2d4d3ec.zip
Bluetooth: Convert inquiry cache to use standard list types
This makes it possible to use the convenience functions provided for standard kernel list types and it also makes it easier to extend the use of the cache for the management interface where e.g. name resolving control will be needed. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/hci_core.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ea9231f4935f..91d1baf05077 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -44,14 +44,14 @@ struct inquiry_data {
};
struct inquiry_entry {
- struct inquiry_entry *next;
+ struct list_head list;
__u32 timestamp;
struct inquiry_data data;
};
struct inquiry_cache {
+ struct list_head list;
__u32 timestamp;
- struct inquiry_entry *list;
};
struct hci_conn_hash {
@@ -350,14 +350,12 @@ extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb);
static inline void inquiry_cache_init(struct hci_dev *hdev)
{
- struct inquiry_cache *c = &hdev->inq_cache;
- c->list = NULL;
+ INIT_LIST_HEAD(&hdev->inq_cache.list);
}
static inline int inquiry_cache_empty(struct hci_dev *hdev)
{
- struct inquiry_cache *c = &hdev->inq_cache;
- return c->list == NULL;
+ return list_empty(&hdev->inq_cache.list);
}
static inline long inquiry_cache_age(struct hci_dev *hdev)