Commit ea4bd8ba804dedefa65303b3bd105d6d2808e621

Authored by David Miller
Committed by Marcel Holtmann
1 parent b7753c8cd5

Bluetooth: Use list_head for HCI blacklist head

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>

Showing 4 changed files with 6 additions and 9 deletions Side-by-side Diff

include/net/bluetooth/hci_core.h
... ... @@ -132,7 +132,7 @@
132 132  
133 133 struct inquiry_cache inq_cache;
134 134 struct hci_conn_hash conn_hash;
135   - struct bdaddr_list blacklist;
  135 + struct list_head blacklist;
136 136  
137 137 struct hci_dev_stats stat;
138 138  
net/bluetooth/hci_core.c
... ... @@ -924,7 +924,7 @@
924 924  
925 925 hci_conn_hash_init(hdev);
926 926  
927   - INIT_LIST_HEAD(&hdev->blacklist.list);
  927 + INIT_LIST_HEAD(&hdev->blacklist);
928 928  
929 929 memset(&hdev->stat, 0, sizeof(struct hci_dev_stats));
930 930  
net/bluetooth/hci_sock.c
... ... @@ -168,9 +168,8 @@
168 168 struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr)
169 169 {
170 170 struct list_head *p;
171   - struct bdaddr_list *blacklist = &hdev->blacklist;
172 171  
173   - list_for_each(p, &blacklist->list) {
  172 + list_for_each(p, &hdev->blacklist) {
174 173 struct bdaddr_list *b;
175 174  
176 175 b = list_entry(p, struct bdaddr_list, list);
... ... @@ -202,7 +201,7 @@
202 201  
203 202 bacpy(&entry->bdaddr, &bdaddr);
204 203  
205   - list_add(&entry->list, &hdev->blacklist.list);
  204 + list_add(&entry->list, &hdev->blacklist);
206 205  
207 206 return 0;
208 207 }
209 208  
... ... @@ -210,9 +209,8 @@
210 209 int hci_blacklist_clear(struct hci_dev *hdev)
211 210 {
212 211 struct list_head *p, *n;
213   - struct bdaddr_list *blacklist = &hdev->blacklist;
214 212  
215   - list_for_each_safe(p, n, &blacklist->list) {
  213 + list_for_each_safe(p, n, &hdev->blacklist) {
216 214 struct bdaddr_list *b;
217 215  
218 216 b = list_entry(p, struct bdaddr_list, list);
net/bluetooth/hci_sysfs.c
... ... @@ -439,12 +439,11 @@
439 439 static int blacklist_show(struct seq_file *f, void *p)
440 440 {
441 441 struct hci_dev *hdev = f->private;
442   - struct bdaddr_list *blacklist = &hdev->blacklist;
443 442 struct list_head *l;
444 443  
445 444 hci_dev_lock_bh(hdev);
446 445  
447   - list_for_each(l, &blacklist->list) {
  446 + list_for_each(l, &hdev->blacklist) {
448 447 struct bdaddr_list *b;
449 448 bdaddr_t bdaddr;
450 449