hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/net/x25/x25_forward.c
....@@ -1,10 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
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
- *
83 * History
94 * 03-01-2007 Added forwarding for x.25 Andrew Hendry
105 */
....@@ -136,13 +131,11 @@
136131
137132 void x25_clear_forward_by_lci(unsigned int lci)
138133 {
139
- struct x25_forward *fwd;
140
- struct list_head *entry, *tmp;
134
+ struct x25_forward *fwd, *tmp;
141135
142136 write_lock_bh(&x25_forward_list_lock);
143137
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) {
146139 if (fwd->lci == lci) {
147140 list_del(&fwd->node);
148141 kfree(fwd);
....@@ -154,13 +147,11 @@
154147
155148 void x25_clear_forward_by_dev(struct net_device *dev)
156149 {
157
- struct x25_forward *fwd;
158
- struct list_head *entry, *tmp;
150
+ struct x25_forward *fwd, *tmp;
159151
160152 write_lock_bh(&x25_forward_list_lock);
161153
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) {
164155 if ((fwd->dev1 == dev) || (fwd->dev2 == dev)){
165156 list_del(&fwd->node);
166157 kfree(fwd);