netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Sowden <jeremy@azazel.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>
Cc: Netfilter Devel <netfilter-devel@vger.kernel.org>
Subject: [PATCH nf-next 6/7] netfilter: ipset: move function to ip_set_bitmap_ip.c.
Date: Thu,  3 Oct 2019 20:56:06 +0100	[thread overview]
Message-ID: <20191003195607.13180-7-jeremy@azazel.net> (raw)
In-Reply-To: <20191003195607.13180-1-jeremy@azazel.net>

One inline function in ip_set_bitmap.h is only called in
ip_set_bitmap_ip.c: move it and remove inline function specifier.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 include/linux/netfilter/ipset/ip_set_bitmap.h | 14 --------------
 net/netfilter/ipset/ip_set_bitmap_ip.c        | 12 ++++++++++++
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/include/linux/netfilter/ipset/ip_set_bitmap.h b/include/linux/netfilter/ipset/ip_set_bitmap.h
index 2dddbc6dcac7..fcc4d214a788 100644
--- a/include/linux/netfilter/ipset/ip_set_bitmap.h
+++ b/include/linux/netfilter/ipset/ip_set_bitmap.h
@@ -12,18 +12,4 @@ enum {
 	IPSET_ADD_START_STORED_TIMEOUT,
 };
 
-/* Common functions */
-
-static inline u32
-range_to_mask(u32 from, u32 to, u8 *bits)
-{
-	u32 mask = 0xFFFFFFFE;
-
-	*bits = 32;
-	while (--(*bits) > 0 && mask && (to & mask) != from)
-		mask <<= 1;
-
-	return mask;
-}
-
 #endif /* __IP_SET_BITMAP_H */
diff --git a/net/netfilter/ipset/ip_set_bitmap_ip.c b/net/netfilter/ipset/ip_set_bitmap_ip.c
index c06172d5b017..abe8f77d7d23 100644
--- a/net/netfilter/ipset/ip_set_bitmap_ip.c
+++ b/net/netfilter/ipset/ip_set_bitmap_ip.c
@@ -237,6 +237,18 @@ init_map_ip(struct ip_set *set, struct bitmap_ip *map,
 	return true;
 }
 
+static u32
+range_to_mask(u32 from, u32 to, u8 *bits)
+{
+	u32 mask = 0xFFFFFFFE;
+
+	*bits = 32;
+	while (--(*bits) > 0 && mask && (to & mask) != from)
+		mask <<= 1;
+
+	return mask;
+}
+
 static int
 bitmap_ip_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
 		 u32 flags)
-- 
2.23.0


  parent reply	other threads:[~2019-10-03 19:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 19:56 [PATCH nf-next 0/7] ipset: remove static inline functions Jeremy Sowden
2019-10-03 19:56 ` [PATCH nf-next 1/7] netfilter: ipset: add a coding-style fix to ip_set_ext_destroy Jeremy Sowden
2019-10-03 19:56 ` [PATCH nf-next 2/7] netfilter: ipset: remove inline from static functions in .c files Jeremy Sowden
2019-10-03 19:56 ` [PATCH nf-next 3/7] netfilter: ipset: move ip_set_comment functions from ip_set.h to ip_set_core.c Jeremy Sowden
2019-10-03 19:56 ` [PATCH nf-next 4/7] netfilter: ipset: move functions " Jeremy Sowden
2019-10-03 19:56 ` [PATCH nf-next 5/7] netfilter: ipset: make ip_set_put_flags extern Jeremy Sowden
2019-10-03 19:56 ` Jeremy Sowden [this message]
2019-10-03 19:56 ` [PATCH nf-next 7/7] netfilter: ipset: move ip_set_get_ip_port() to ip_set_bitmap_port.c Jeremy Sowden
2019-10-07 20:08 ` [PATCH nf-next 0/7] ipset: remove static inline functions Kadlecsik József
2019-10-07 22:00   ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191003195607.13180-7-jeremy@azazel.net \
    --to=jeremy@azazel.net \
    --cc=kadlec@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).