Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp150326iob; Wed, 27 Apr 2022 22:14:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzRI83DfdbHTke28CyTmxfQT7K77i338amrR4sC0QJBiJhL9E4yc/UGx6mCbkLjNCmFGaY X-Received: by 2002:a17:906:6a11:b0:6e8:d248:f8ea with SMTP id qw17-20020a1709066a1100b006e8d248f8eamr29528702ejc.500.1651122863834; Wed, 27 Apr 2022 22:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651122863; cv=none; d=google.com; s=arc-20160816; b=WEyfXl9qmVNh9lUWlbbjidA2uq9mgMUIo1rvM0EpGg7X76mhaiQf5ycEL/VdE6Qnd8 SmRczJEHOBzFxVwQ8Bw9I7LwRJ99Q/2m31ZZNVBlflQSuDoii9Qp161TJtUWLWsX+ZQ/ GNLJT3zShaA1cGm7LoB0oazPcMKejTlXe2Nzg3GJL/VMO87ZR1cndrqzhzI6Gfd9bRXM NJsclSWtuv7zvvcTKxpjMG9CIMd3LH8iBcc3Ied74EmlqleoD3vGZnriSr/YKhWkYr+q 4iXNPqhMIFzmtkN+CSEjoF8qYzdG62VGQHNuhaQsU98gQT77sxQi/Jql+hiUAsG7kJRB b5Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9TjwB1FTuGbK/nxnFw4g+yurxGpo+tp+h6ik2UYFFps=; b=dsdJJRELVyLZUCnE6BvdePOJjdpBSrnaUKk2M0TnbUwtb6kYv5ADuYCk7pEXFMw5/c utwlty93VWNq1X+B5lkggKCALrWTnGTGDDeLV5WtmcQjmejQnjzB1VOk+uWwWQXLzrCk srXC67ZHTJS6kfYgfS6UnJ6X1/ocp+9VqJPn8uwPtj5uFzRuwHX/RHLYiMJllkHVmq28 qDMxPczwvssF83S/oQ6gbUzq0Xr3MOAzrPAlQ+DQamaSb0JB0k95oMTNn6XHfchPTOOA X9UXwUVk6BRAsdREg/hMhue0bM+NvvYIFhIgldlp7QJU3EaCGcp94WzdNM9gSjShJorT ky2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hbscj8hq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m22-20020a1709061ed600b006df76385d57si2998042ejj.503.2022.04.27.22.13.58; Wed, 27 Apr 2022 22:14:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hbscj8hq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241928AbiD1DJV (ORCPT + 99 others); Wed, 27 Apr 2022 23:09:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241897AbiD1DJT (ORCPT ); Wed, 27 Apr 2022 23:09:19 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3058B2DD65 for ; Wed, 27 Apr 2022 20:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651115165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9TjwB1FTuGbK/nxnFw4g+yurxGpo+tp+h6ik2UYFFps=; b=hbscj8hqOkh2g4fT5zMjJM7UQq2staRZ+Rk10RzWtnshzu7V3IW+NAPWl0pRM+yg1+0Zx9 N0EB1isfkIp7yLrXBeIIUM3rsagaFi6aDbpwLuT8sfK9YRfcwQMTNe61aBjYVdFa3kApOE 7d53X4rDP4xvzVQaa2jxYafTfRehDgA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-GFvNEVLuMxaifYtn8deXBg-1; Wed, 27 Apr 2022 23:05:59 -0400 X-MC-Unique: GFvNEVLuMxaifYtn8deXBg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6AB8529AA2EE; Thu, 28 Apr 2022 03:05:59 +0000 (UTC) Received: from fs-i40c-03.fs.lab.eng.bos.redhat.com (fs-i40c-03.fs.lab.eng.bos.redhat.com [10.16.224.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 427582166B4D; Thu, 28 Apr 2022 03:05:59 +0000 (UTC) From: Alexander Aring To: jukka.rissanen@linux.intel.com Cc: linux-bluetooth@vger.kernel.org, linux-wpan@vger.kernel.org, stefan@datenfreihafen.org, torvalds@linuxfoundation.org Subject: [PATCH bluetooth-next 3/3] net: 6lowpan: constify lowpan_nhc structures Date: Wed, 27 Apr 2022 23:05:34 -0400 Message-Id: <20220428030534.3220410-4-aahringo@redhat.com> In-Reply-To: <20220428030534.3220410-1-aahringo@redhat.com> References: <20220428030534.3220410-1-aahringo@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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 --- net/6lowpan/nhc.c | 16 ++++++++-------- net/6lowpan/nhc.h | 6 +++--- 2 files changed, 11 insertions(+), 11 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 @@ int lowpan_nhc_add(struct lowpan_nhc *nhc) } 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); diff --git a/net/6lowpan/nhc.h b/net/6lowpan/nhc.h index 9df602a632bd..ab7b4977c32b 100644 --- a/net/6lowpan/nhc.h +++ b/net/6lowpan/nhc.h @@ -24,7 +24,7 @@ #define LOWPAN_NHC(__nhc, _name, _nexthdr, \ _hdrlen, _id, _idmask, \ _uncompress, _compress) \ -static struct lowpan_nhc __nhc = { \ +static const struct lowpan_nhc __nhc = { \ .name = _name, \ .nexthdr = _nexthdr, \ .nexthdrlen = _hdrlen, \ @@ -116,14 +116,14 @@ int lowpan_nhc_do_uncompression(struct sk_buff *skb, * * @nhc: nhc which should be add. */ -int lowpan_nhc_add(struct lowpan_nhc *nhc); +int lowpan_nhc_add(const struct lowpan_nhc *nhc); /** * lowpan_nhc_del - delete a next header compression from framework * * @nhc: nhc which should be delete. */ -void lowpan_nhc_del(struct lowpan_nhc *nhc); +void lowpan_nhc_del(const struct lowpan_nhc *nhc); /** * lowpan_nhc_init - adding all default nhcs -- 2.31.1