Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8148f75 authored by WANG Cong's avatar WANG Cong Committed by Linus Torvalds
Browse files

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: default avatarWANG Cong <wangcong@zeuux.org>
Cc: Nadia Derbey <Nadia.Derbey@bull.net>
Cc: Pierre Peiffer <peifferp@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8cd3ac3a
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ void shm_init_ns(struct ipc_namespace *ns)
	ns->shm_ctlall = SHMALL;
	ns->shm_ctlmni = SHMMNI;
	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;
		int result;

		if (!buf) {
			err = -EFAULT;
			goto out;
		}

		if (cmd == SHM_STAT) {
			shp = shm_lock(ns, shmid);
			if (IS_ERR(shp)) {