mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-02 20:29:20 +00:00
ipc: introduce the ipcid_to_idx macro
This is a trivial patch that changes all the (id % SEQ_MULTIPLIER) into a call to the ipcid_to_idx(id) macro. 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>
This commit is contained in:
parent
03f02c7657
commit
ce621f5ba5
2 changed files with 4 additions and 2 deletions
|
@ -413,7 +413,7 @@ int ipcget_public(struct ipc_namespace *ns, struct ipc_ids *ids,
|
|||
|
||||
void ipc_rmid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp)
|
||||
{
|
||||
int lid = ipcp->id % SEQ_MULTIPLIER;
|
||||
int lid = ipcid_to_idx(ipcp->id);
|
||||
|
||||
idr_remove(&ids->ipcs_idr, lid);
|
||||
|
||||
|
@ -672,7 +672,7 @@ void ipc64_perm_to_ipc_perm (struct ipc64_perm *in, struct ipc_perm *out)
|
|||
struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id)
|
||||
{
|
||||
struct kern_ipc_perm *out;
|
||||
int lid = id % SEQ_MULTIPLIER;
|
||||
int lid = ipcid_to_idx(id);
|
||||
|
||||
rcu_read_lock();
|
||||
out = idr_find(&ids->ipcs_idr, lid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue