* [PATCH] Bluetooth: Refactor mgmt_pending_foreach
@ 2013-02-01 14:21 Andre Guedes
2013-02-01 17:27 ` Gustavo Padovan
0 siblings, 1 reply; 2+ messages in thread
From: Andre Guedes @ 2013-02-01 14:21 UTC (permalink / raw)
To: linux-bluetooth
This patch does a trivial refactor in mgmt_pending_foreach function.
It replaces list_for_each_safe by list_for_each_entry_safe, simplifying
the function.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
net/bluetooth/mgmt.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 3bd4c41..39395c7 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -760,13 +760,9 @@ static void mgmt_pending_foreach(u16 opcode, struct hci_dev *hdev,
void *data),
void *data)
{
- struct list_head *p, *n;
-
- list_for_each_safe(p, n, &hdev->mgmt_pending) {
- struct pending_cmd *cmd;
-
- cmd = list_entry(p, struct pending_cmd, list);
+ struct pending_cmd *cmd, *tmp;
+ list_for_each_entry_safe(cmd, tmp, &hdev->mgmt_pending, list) {
if (opcode > 0 && cmd->opcode != opcode)
continue;
--
1.8.1.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-01 17:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-01 14:21 [PATCH] Bluetooth: Refactor mgmt_pending_foreach Andre Guedes
2013-02-01 17:27 ` Gustavo Padovan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox