aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sysfs.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2011-11-01 04:58:56 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-11-07 14:24:46 -0500
commit8035ded466049ca2fe8c04564a0fa00f222abe3f (patch)
treef589157028c85ebaa17be9f329405d1ccffa6304 /net/bluetooth/hci_sysfs.c
parent457f48507deb0e8c8dd299c7d8dce7c2c0e291e8 (diff)
Bluetooth: replace list_for_each with list_for_each_entry whenever possible
When all items in the list have the same type there is no much of a point to use list_for_each except if you want to use the list pointer itself. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_sysfs.c')
-rw-r--r--net/bluetooth/hci_sysfs.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 1f9f8769e130..f8e6aa386cef 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -435,17 +435,12 @@ static const struct file_operations inquiry_cache_fops = {
435static int blacklist_show(struct seq_file *f, void *p) 435static int blacklist_show(struct seq_file *f, void *p)
436{ 436{
437 struct hci_dev *hdev = f->private; 437 struct hci_dev *hdev = f->private;
438 struct list_head *l; 438 struct bdaddr_list *b;
439 439
440 hci_dev_lock_bh(hdev); 440 hci_dev_lock_bh(hdev);
441 441
442 list_for_each(l, &hdev->blacklist) { 442 list_for_each_entry(b, &hdev->blacklist, list)
443 struct bdaddr_list *b;
444
445 b = list_entry(l, struct bdaddr_list, list);
446
447 seq_printf(f, "%s\n", batostr(&b->bdaddr)); 443 seq_printf(f, "%s\n", batostr(&b->bdaddr));
448 }
449 444
450 hci_dev_unlock_bh(hdev); 445 hci_dev_unlock_bh(hdev);
451 446
@@ -484,17 +479,12 @@ static void print_bt_uuid(struct seq_file *f, u8 *uuid)
484static int uuids_show(struct seq_file *f, void *p) 479static int uuids_show(struct seq_file *f, void *p)
485{ 480{
486 struct hci_dev *hdev = f->private; 481 struct hci_dev *hdev = f->private;
487 struct list_head *l; 482 struct bt_uuid *uuid;
488 483
489 hci_dev_lock_bh(hdev); 484 hci_dev_lock_bh(hdev);
490 485
491 list_for_each(l, &hdev->uuids) { 486 list_for_each_entry(uuid, &hdev->uuids, list)
492 struct bt_uuid *uuid;
493
494 uuid = list_entry(l, struct bt_uuid, list);
495
496 print_bt_uuid(f, uuid->uuid); 487 print_bt_uuid(f, uuid->uuid);
497 }
498 488
499 hci_dev_unlock_bh(hdev); 489 hci_dev_unlock_bh(hdev);
500 490