ipc: clean up ipc/shm.c

Use the macro shm_ids().

Remove useless check for a userspace pointer, because copy_to_user()
will check it.

Some style cleanups.

Signed-off-by: WANG Cong <wangcong@zeuux.org>
Cc: Nadia Derbey <Nadia.Derbey@bull.net>
Cc: Pierre Peiffer <peifferp@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
WANG Cong
2009-01-06 14:42:49 -08:00
committed by Linus Torvalds
parent 8cd3ac3aca
commit e8148f7588

View File

@@ -75,7 +75,7 @@ void shm_init_ns(struct ipc_namespace *ns)
ns->shm_ctlall = SHMALL; ns->shm_ctlall = SHMALL;
ns->shm_ctlmni = SHMMNI; ns->shm_ctlmni = SHMMNI;
ns->shm_tot = 0; ns->shm_tot = 0;
ipc_init_ids(&ns->ids[IPC_SHM_IDS]); ipc_init_ids(&shm_ids(ns));
} }
/* /*
@@ -692,11 +692,6 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf)
struct shmid64_ds tbuf; struct shmid64_ds tbuf;
int result; int result;
if (!buf) {
err = -EFAULT;
goto out;
}
if (cmd == SHM_STAT) { if (cmd == SHM_STAT) {
shp = shm_lock(ns, shmid); shp = shm_lock(ns, shmid);
if (IS_ERR(shp)) { if (IS_ERR(shp)) {