summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2011-04-19 19:11:23 +0200
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-05-10 22:03:54 +0200
commit1f3de471adf5c2a584480a6010808d7a17063897 (patch)
treef3929161b89dd5da7cd750e107cedd6064793fd4 /net
parenttipc: Fix sk_buff leaks when link congestion is detected (diff)
downloadlinux-1f3de471adf5c2a584480a6010808d7a17063897.tar.xz
linux-1f3de471adf5c2a584480a6010808d7a17063897.zip
tipc: make zone/cluster mask constants a define
This allows them to be available for easy re-use in other places and avoids trivial mistakes caused by "count the f's and 0's". Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/addr.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/tipc/addr.h b/net/tipc/addr.h
index 8971aba99aea..e4f35afe3207 100644
--- a/net/tipc/addr.h
+++ b/net/tipc/addr.h
@@ -37,14 +37,17 @@
#ifndef _TIPC_ADDR_H
#define _TIPC_ADDR_H
+#define TIPC_ZONE_MASK 0xff000000u
+#define TIPC_CLUSTER_MASK 0xfffff000u
+
static inline u32 tipc_zone_mask(u32 addr)
{
- return addr & 0xff000000u;
+ return addr & TIPC_ZONE_MASK;
}
static inline u32 tipc_cluster_mask(u32 addr)
{
- return addr & 0xfffff000u;
+ return addr & TIPC_CLUSTER_MASK;
}
static inline int in_own_cluster(u32 addr)