svn commit: r236832 - head/sys/kern

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Jun 10 06:31:54 UTC 2012


Author: pjd
Date: Sun Jun 10 06:31:54 2012
New Revision: 236832
URL: http://svn.freebsd.org/changeset/base/236832

Log:
  Simplify fdtofp().
  
  MFC after:	1 month

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Sun Jun 10 05:24:24 2012	(r236831)
+++ head/sys/kern/kern_descrip.c	Sun Jun 10 06:31:54 2012	(r236832)
@@ -430,13 +430,13 @@ sys_fcntl(struct thread *td, struct fcnt
 static inline struct file *
 fdtofp(int fd, struct filedesc *fdp)
 {
-	struct file *fp;
 
 	FILEDESC_LOCK_ASSERT(fdp);
-	if ((unsigned)fd >= fdp->fd_nfiles ||
-	    (fp = fdp->fd_ofiles[fd]) == NULL)
+
+	if ((unsigned)fd >= fdp->fd_nfiles)
 		return (NULL);
-	return (fp);
+
+	return (fdp->fd_ofiles[fd]);
 }
 
 static inline int


More information about the svn-src-all mailing list