Skip to content

Commit

Permalink
ipc: inline ipc_buildid()
Browse files Browse the repository at this point in the history
This is a trivial patch that changes the ipc_buildid() routine into a static
inline.

Signed-off-by: Nadia Derbey <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Nadia Derbey authored and Linus Torvalds committed Oct 19, 2007
1 parent ce621f5 commit 2802831
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 0 additions & 5 deletions ipc/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,6 @@ struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id)
return out;
}

int ipc_buildid(struct ipc_ids* ids, int id, int seq)
{
return SEQ_MULTIPLIER*seq + id;
}

#ifdef __ARCH_WANT_IPC_PARSE_VERSION


Expand Down
6 changes: 5 additions & 1 deletion ipc/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ void ipc_rcu_getref(void *ptr);
void ipc_rcu_putref(void *ptr);

struct kern_ipc_perm *ipc_lock(struct ipc_ids *, int);
int ipc_buildid(struct ipc_ids* ids, int id, int seq);

void kernel_to_ipc64_perm(struct kern_ipc_perm *in, struct ipc64_perm *out);
void ipc64_perm_to_ipc_perm(struct ipc64_perm *in, struct ipc_perm *out);
Expand All @@ -127,6 +126,11 @@ extern int ipcget_new(struct ipc_namespace *, struct ipc_ids *,
extern int ipcget_public(struct ipc_namespace *, struct ipc_ids *,
struct ipc_ops *, struct ipc_params *);

static inline int ipc_buildid(struct ipc_ids *ids, int id, int seq)
{
return SEQ_MULTIPLIER * seq + id;
}

static inline int ipc_checkid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp,
int uid)
{
Expand Down

0 comments on commit 2802831

Please sign in to comment.