Skip to content

Commit

Permalink
tipc: make zone/cluster mask constants a define
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Paul Gortmaker committed May 10, 2011
1 parent bebc55a commit 1f3de47
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/tipc/addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1f3de47

Please sign in to comment.