[PATCH 2/6] ipset/iptreemap: Use min/max from kernel.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use min/max from kernel.h instead of defining our own.

Signed-off-by: Sven Wegener <sven.wegener@xxxxxxxxxxx>
---
 .../net/ipv4/netfilter/ip_set_iptreemap.c          |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/patchlets/set/linux-2.6/net/ipv4/netfilter/ip_set_iptreemap.c b/patchlets/set/linux-2.6/net/ipv4/netfilter/ip_set_iptreemap.c
index fcf882e..dfd486a 100644
--- a/patchlets/set/linux-2.6/net/ipv4/netfilter/ip_set_iptreemap.c
+++ b/patchlets/set/linux-2.6/net/ipv4/netfilter/ip_set_iptreemap.c
@@ -12,6 +12,7 @@
  */
 
 #include <linux/version.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/ip.h>
 #include <linux/skbuff.h>
@@ -186,9 +187,6 @@ static struct ip_set_iptreemap_b *fullbitmap_b;
 #define LOOP_WALK_END_COUNT() \
 	}
 
-#define MIN(a, b) (a < b ? a : b)
-#define MAX(a, b) (a > b ? a : b)
-
 #define GETVALUE1(a, a1, b1, r) \
 	(a == a1 ? b1 : r)
 
@@ -377,7 +375,7 @@ addip(struct ip_set *set, const void *data, size_t size, ip_set_ip_t *hash_ip)
 		return -EINVAL;
 	}
 
-	return __addip_range(set, MIN(req->start, req->end), MAX(req->start, req->end), hash_ip);
+	return __addip_range(set, min(req->start, req->end), max(req->start, req->end), hash_ip);
 }
 
 static int
@@ -464,7 +462,7 @@ delip(struct ip_set *set, const void *data, size_t size, ip_set_ip_t *hash_ip)
 		return -EINVAL;
 	}
 
-	return __delip_range(set, MIN(req->start, req->end), MAX(req->start, req->end), hash_ip, GFP_KERNEL);
+	return __delip_range(set, min(req->start, req->end), max(req->start, req->end), hash_ip, GFP_KERNEL);
 }
 
 static int
-- 
1.5.6.1

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux