summaryrefslogtreecommitdiff
path: root/net/6lowpan/nhc.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2022-04-28 06:05:34 +0300
committerStefan Schmidt <stefan@datenfreihafen.org>2022-06-09 22:53:28 +0300
commitf3de6f4eccddfcaf3f8b3674ab57a0646b572650 (patch)
tree8d92396a3ef6cb763103c15e6b5079dc760ebe1b /net/6lowpan/nhc.c
parent31264f9563e6c2b2f895582e0632881cbc197af9 (diff)
downloadlinux-f3de6f4eccddfcaf3f8b3674ab57a0646b572650.tar.xz
net: 6lowpan: constify lowpan_nhc structures
This patch constify the lowpan_nhc declarations. Since we drop the rb node datastructure there is no need for runtime manipulation of this structure. Signed-off-by: Alexander Aring <aahringo@redhat.com> Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Link: https://lore.kernel.org/r/20220428030534.3220410-4-aahringo@redhat.com Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'net/6lowpan/nhc.c')
-rw-r--r--net/6lowpan/nhc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/6lowpan/nhc.c b/net/6lowpan/nhc.c
index 019f121b2449..7b374595328d 100644
--- a/net/6lowpan/nhc.c
+++ b/net/6lowpan/nhc.c
@@ -12,12 +12,12 @@
#include "nhc.h"
-static struct lowpan_nhc *lowpan_nexthdr_nhcs[NEXTHDR_MAX + 1];
+static const struct lowpan_nhc *lowpan_nexthdr_nhcs[NEXTHDR_MAX + 1];
static DEFINE_SPINLOCK(lowpan_nhc_lock);
-static struct lowpan_nhc *lowpan_nhc_by_nhcid(struct sk_buff *skb)
+static const struct lowpan_nhc *lowpan_nhc_by_nhcid(struct sk_buff *skb)
{
- struct lowpan_nhc *nhc;
+ const struct lowpan_nhc *nhc;
int i;
u8 id;
@@ -41,7 +41,7 @@ static struct lowpan_nhc *lowpan_nhc_by_nhcid(struct sk_buff *skb)
int lowpan_nhc_check_compression(struct sk_buff *skb,
const struct ipv6hdr *hdr, u8 **hc_ptr)
{
- struct lowpan_nhc *nhc;
+ const struct lowpan_nhc *nhc;
int ret = 0;
spin_lock_bh(&lowpan_nhc_lock);
@@ -59,7 +59,7 @@ int lowpan_nhc_do_compression(struct sk_buff *skb, const struct ipv6hdr *hdr,
u8 **hc_ptr)
{
int ret;
- struct lowpan_nhc *nhc;
+ const struct lowpan_nhc *nhc;
spin_lock_bh(&lowpan_nhc_lock);
@@ -102,7 +102,7 @@ int lowpan_nhc_do_uncompression(struct sk_buff *skb,
const struct net_device *dev,
struct ipv6hdr *hdr)
{
- struct lowpan_nhc *nhc;
+ const struct lowpan_nhc *nhc;
int ret;
spin_lock_bh(&lowpan_nhc_lock);
@@ -138,7 +138,7 @@ int lowpan_nhc_do_uncompression(struct sk_buff *skb,
return 0;
}
-int lowpan_nhc_add(struct lowpan_nhc *nhc)
+int lowpan_nhc_add(const struct lowpan_nhc *nhc)
{
int ret = 0;
@@ -156,7 +156,7 @@ out:
}
EXPORT_SYMBOL(lowpan_nhc_add);
-void lowpan_nhc_del(struct lowpan_nhc *nhc)
+void lowpan_nhc_del(const struct lowpan_nhc *nhc)
{
spin_lock_bh(&lowpan_nhc_lock);