| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This module: |
|---|
| 3 | | - * This module is free software; you can redistribute it and/or |
|---|
| 4 | | - * modify it under the terms of the GNU General Public License |
|---|
| 5 | | - * as published by the Free Software Foundation; either version |
|---|
| 6 | | - * 2 of the License, or (at your option) any later version. |
|---|
| 7 | | - * |
|---|
| 8 | 3 | * History |
|---|
| 9 | 4 | * 03-01-2007 Added forwarding for x.25 Andrew Hendry |
|---|
| 10 | 5 | */ |
|---|
| .. | .. |
|---|
| 136 | 131 | |
|---|
| 137 | 132 | void x25_clear_forward_by_lci(unsigned int lci) |
|---|
| 138 | 133 | { |
|---|
| 139 | | - struct x25_forward *fwd; |
|---|
| 140 | | - struct list_head *entry, *tmp; |
|---|
| 134 | + struct x25_forward *fwd, *tmp; |
|---|
| 141 | 135 | |
|---|
| 142 | 136 | write_lock_bh(&x25_forward_list_lock); |
|---|
| 143 | 137 | |
|---|
| 144 | | - list_for_each_safe(entry, tmp, &x25_forward_list) { |
|---|
| 145 | | - fwd = list_entry(entry, struct x25_forward, node); |
|---|
| 138 | + list_for_each_entry_safe(fwd, tmp, &x25_forward_list, node) { |
|---|
| 146 | 139 | if (fwd->lci == lci) { |
|---|
| 147 | 140 | list_del(&fwd->node); |
|---|
| 148 | 141 | kfree(fwd); |
|---|
| .. | .. |
|---|
| 154 | 147 | |
|---|
| 155 | 148 | void x25_clear_forward_by_dev(struct net_device *dev) |
|---|
| 156 | 149 | { |
|---|
| 157 | | - struct x25_forward *fwd; |
|---|
| 158 | | - struct list_head *entry, *tmp; |
|---|
| 150 | + struct x25_forward *fwd, *tmp; |
|---|
| 159 | 151 | |
|---|
| 160 | 152 | write_lock_bh(&x25_forward_list_lock); |
|---|
| 161 | 153 | |
|---|
| 162 | | - list_for_each_safe(entry, tmp, &x25_forward_list) { |
|---|
| 163 | | - fwd = list_entry(entry, struct x25_forward, node); |
|---|
| 154 | + list_for_each_entry_safe(fwd, tmp, &x25_forward_list, node) { |
|---|
| 164 | 155 | if ((fwd->dev1 == dev) || (fwd->dev2 == dev)){ |
|---|
| 165 | 156 | list_del(&fwd->node); |
|---|
| 166 | 157 | kfree(fwd); |
|---|