Skip to content

Commit 2802831

Browse files
Nadia DerbeyLinus Torvalds
authored andcommitted
ipc: inline ipc_buildid()
This is a trivial patch that changes the ipc_buildid() routine into a static inline. Signed-off-by: Nadia Derbey <Nadia.Derbey@bull.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ce621f5 commit 2802831

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎ipc/util.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,6 @@ struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id)
695695
return out;
696696
}
697697

698-
int ipc_buildid(struct ipc_ids* ids, int id, int seq)
699-
{
700-
return SEQ_MULTIPLIER*seq + id;
701-
}
702-
703698
#ifdef __ARCH_WANT_IPC_PARSE_VERSION
704699

705700

‎ipc/util.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ void ipc_rcu_getref(void *ptr);
107107
void ipc_rcu_putref(void *ptr);
108108

109109
struct kern_ipc_perm *ipc_lock(struct ipc_ids *, int);
110-
int ipc_buildid(struct ipc_ids* ids, int id, int seq);
111110

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

129+
static inline int ipc_buildid(struct ipc_ids *ids, int id, int seq)
130+
{
131+
return SEQ_MULTIPLIER * seq + id;
132+
}
133+
130134
static inline int ipc_checkid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp,
131135
int uid)
132136
{

0 commit comments

Comments
 (0)