Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
[firefly-linux-kernel-4.4.55.git] / net / tipc / core.h
index 0fcf133d5cb7cef0f33478412cb75809b68a8223..b96b41eabf121cc8577b65d0ad5bb0727ca5d3f7 100644 (file)
@@ -109,6 +109,11 @@ struct tipc_net {
        atomic_t subscription_count;
 };
 
+static inline struct tipc_net *tipc_net(struct net *net)
+{
+       return net_generic(net, tipc_net_id);
+}
+
 static inline u16 mod(u16 x)
 {
        return x & 0xffffu;
@@ -129,6 +134,11 @@ static inline int less(u16 left, u16 right)
        return less_eq(left, right) && (mod(right) != mod(left));
 }
 
+static inline int in_range(u16 val, u16 min, u16 max)
+{
+       return !less(val, min) && !more(val, max);
+}
+
 #ifdef CONFIG_SYSCTL
 int tipc_register_sysctl(void);
 void tipc_unregister_sysctl(void);