svn commit: r340344 - head/sys/kern

Konstantin Belousov kib at FreeBSD.org
Sun Nov 11 00:21:29 UTC 2018


Author: kib
Date: Sun Nov 11 00:21:28 2018
New Revision: 340344
URL: https://svnweb.freebsd.org/changeset/base/340344

Log:
  Remove one-use variable.
  
  This also removes a lot of #ifdefs and cleans up a warning when the
  AUDIT kernel option is defined, but neither KDTRACE_HOOKS nor MAC are.
  
  Reported and tested by:	danger
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c	Sun Nov 11 00:04:36 2018	(r340343)
+++ head/sys/kern/sysv_shm.c	Sun Nov 11 00:21:28 2018	(r340344)
@@ -332,9 +332,6 @@ kern_shmdt_locked(struct thread *td, const void *shmad
 {
 	struct proc *p = td->td_proc;
 	struct shmmap_state *shmmap_s;
-#if defined(AUDIT) || defined(MAC)
-	struct shmid_kernel *shmsegptr;
-#endif
 #ifdef MAC
 	int error;
 #endif
@@ -355,11 +352,9 @@ kern_shmdt_locked(struct thread *td, const void *shmad
 	}
 	if (i == shminfo.shmseg)
 		return (EINVAL);
-#if (defined(AUDIT) && defined(KDTRACE_HOOKS)) || defined(MAC)
-	shmsegptr = &shmsegs[IPCID_TO_IX(shmmap_s->shmid)];
-#endif
 #ifdef MAC
-	error = mac_sysvshm_check_shmdt(td->td_ucred, shmsegptr);
+	error = mac_sysvshm_check_shmdt(td->td_ucred,
+	    &shmsegs[IPCID_TO_IX(shmmap_s->shmid)]);
 	if (error != 0)
 		return (error);
 #endif


More information about the svn-src-head mailing list