]> granicus.if.org Git - ipset/commitdiff
netfilter: ipset: move function to ip_set_bitmap_ip.c.
authorJeremy Sowden <jeremy@azazel.net>
Thu, 3 Oct 2019 19:56:06 +0000 (20:56 +0100)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 7 Oct 2019 19:52:49 +0000 (21:52 +0200)
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>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
kernel/include/linux/netfilter/ipset/ip_set_bitmap.h
kernel/net/netfilter/ipset/ip_set_bitmap_ip.c

index 2dddbc6dcac708661c6f11680a861461cf84dbc4..fcc4d214a78837c2622d0d412018380af00aecda 100644 (file)
@@ -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 */
index 4c0a6592d8bb636a6f3fb72047e0f76063a38160..260c339368b02f2084956bcc780d09f6f04d0e2a 100644 (file)
@@ -244,6 +244,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)