]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
Bluetooth: Use list_head for HCI blacklist head
authorDavid Miller <davem@davemloft.net>
Sat, 31 Jul 2010 04:54:49 +0000 (21:54 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 31 Jul 2010 23:06:58 +0000 (16:06 -0700)
The bdaddr in the list root is completely unused and just
taking up space.

Signed-off-by: David S. Miller <davem@davemloft.net>
Tested-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c
net/bluetooth/hci_sock.c
net/bluetooth/hci_sysfs.c

index 8b28962e737ececccfe590a70f034e8eee66969a..4568b938ca35ab56062ba202c0294df37dae037d 100644 (file)
@@ -132,7 +132,7 @@ struct hci_dev {
 
        struct inquiry_cache    inq_cache;
        struct hci_conn_hash    conn_hash;
-       struct bdaddr_list      blacklist;
+       struct list_head        blacklist;
 
        struct hci_dev_stats    stat;
 
index 8303f1c9ef548a13ab7ecfa8f2403b0a048f413e..c52f091ee6de2c4b1e81f68363086e2af4a51660 100644 (file)
@@ -924,7 +924,7 @@ int hci_register_dev(struct hci_dev *hdev)
 
        hci_conn_hash_init(hdev);
 
-       INIT_LIST_HEAD(&hdev->blacklist.list);
+       INIT_LIST_HEAD(&hdev->blacklist);
 
        memset(&hdev->stat, 0, sizeof(struct hci_dev_stats));
 
index 4f170a59593474ca174f4e266f39931de57e0212..83acd164d39e33d0401edd09273bdfe9223d6284 100644 (file)
@@ -168,9 +168,8 @@ static int hci_sock_release(struct socket *sock)
 struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr)
 {
        struct list_head *p;
-       struct bdaddr_list *blacklist = &hdev->blacklist;
 
-       list_for_each(p, &blacklist->list) {
+       list_for_each(p, &hdev->blacklist) {
                struct bdaddr_list *b;
 
                b = list_entry(p, struct bdaddr_list, list);
@@ -202,7 +201,7 @@ static int hci_blacklist_add(struct hci_dev *hdev, void __user *arg)
 
        bacpy(&entry->bdaddr, &bdaddr);
 
-       list_add(&entry->list, &hdev->blacklist.list);
+       list_add(&entry->list, &hdev->blacklist);
 
        return 0;
 }
@@ -210,9 +209,8 @@ static int hci_blacklist_add(struct hci_dev *hdev, void __user *arg)
 int hci_blacklist_clear(struct hci_dev *hdev)
 {
        struct list_head *p, *n;
-       struct bdaddr_list *blacklist = &hdev->blacklist;
 
-       list_for_each_safe(p, n, &blacklist->list) {
+       list_for_each_safe(p, n, &hdev->blacklist) {
                struct bdaddr_list *b;
 
                b = list_entry(p, struct bdaddr_list, list);
index ce44c47eeac1a028e0463dcf12ebddb4ba9774fc..8fb967beee80bd617597d5e8f7eba981206361c9 100644 (file)
@@ -439,12 +439,11 @@ static const struct file_operations inquiry_cache_fops = {
 static int blacklist_show(struct seq_file *f, void *p)
 {
        struct hci_dev *hdev = f->private;
-       struct bdaddr_list *blacklist = &hdev->blacklist;
        struct list_head *l;
 
        hci_dev_lock_bh(hdev);
 
-       list_for_each(l, &blacklist->list) {
+       list_for_each(l, &hdev->blacklist) {
                struct bdaddr_list *b;
                bdaddr_t bdaddr;