Skip to content

Commit

Permalink
Bluetooth: Refactor mgmt_pending_foreach
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
Andre Guedes authored and Gustavo Padovan committed Feb 1, 2013
1 parent 2b8a9a2 commit a3d0935
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a3d0935

Please sign in to comment.