forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/net/802/mrp.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * IEEE 802.1Q Multiple Registration Protocol (MRP)
34 *
....@@ -5,10 +6,6 @@
56 *
67 * Adapted from code in net/802/garp.c
78 * Copyright (c) 2008 Patrick McHardy <kaber@trash.net>
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License
11
- * version 2 as published by the Free Software Foundation.
129 */
1310 #include <linux/kernel.h>
1411 #include <linux/timer.h>
....@@ -539,7 +536,7 @@
539536 struct mrp_attr *attr;
540537
541538 if (sizeof(struct mrp_skb_cb) + len >
542
- FIELD_SIZEOF(struct sk_buff, cb))
539
+ sizeof_field(struct sk_buff, cb))
543540 return -ENOMEM;
544541
545542 spin_lock_bh(&app->lock);
....@@ -564,7 +561,7 @@
564561 struct mrp_attr *attr;
565562
566563 if (sizeof(struct mrp_skb_cb) + len >
567
- FIELD_SIZEOF(struct sk_buff, cb))
564
+ sizeof_field(struct sk_buff, cb))
568565 return;
569566
570567 spin_lock_bh(&app->lock);
....@@ -708,7 +705,7 @@
708705 * advance to the next event in its Vector.
709706 */
710707 if (sizeof(struct mrp_skb_cb) + mrp_cb(skb)->mh->attrlen >
711
- FIELD_SIZEOF(struct sk_buff, cb))
708
+ sizeof_field(struct sk_buff, cb))
712709 return -1;
713710 if (skb_copy_bits(skb, *offset, mrp_cb(skb)->attrvalue,
714711 mrp_cb(skb)->mh->attrlen) < 0)