Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern KNF, add a comment and an assertion.



details:   https://anonhg.NetBSD.org/src/rev/53c0bdb7ca75
branches:  trunk
changeset: 763972:53c0bdb7ca75
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Apr 09 07:02:57 2011 +0000

description:
KNF, add a comment and an assertion.

diffstat:

 sys/kern/tty_pty.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 9d8e44d7cfbc -r 53c0bdb7ca75 sys/kern/tty_pty.c
--- a/sys/kern/tty_pty.c        Sat Apr 09 06:36:03 2011 +0000
+++ b/sys/kern/tty_pty.c        Sat Apr 09 07:02:57 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty_pty.c,v 1.125 2011/04/09 06:34:06 martin Exp $     */
+/*     $NetBSD: tty_pty.c,v 1.126 2011/04/09 07:02:57 martin Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.125 2011/04/09 06:34:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.126 2011/04/09 07:02:57 martin Exp $");
 
 #include "opt_ptm.h"
 
@@ -523,11 +523,13 @@
 void
 ptcwakeup(struct tty *tp, int flag)
 {
-       struct pt_softc *pti = NULL;
+       struct pt_softc *pti;
 
-       if (tp->t_dev == NODEV) return;
+       if (tp->t_dev == NODEV)
+               return; /* client side not open yet */
 
        pti = pt_softc[minor(tp->t_dev)];
+       KASSERT(pti != NULL);
 
        mutex_spin_enter(&tty_lock);
        if (flag & FREAD) {



Home | Main Index | Thread Index | Old Index