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
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to