Source-Changes-HG archive

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

[src/trunk]: src/sys ttycheckoutq(9): wait=0 always, parameter no longer usef...



details:   https://anonhg.NetBSD.org/src/rev/21dcc661e042
branches:  trunk
changeset: 374237:21dcc661e042
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Apr 12 06:35:26 2023 +0000

description:
ttycheckoutq(9): wait=0 always, parameter no longer useful, nix it.

XXX kernel revbump

diffstat:

 sys/kern/subr_prf.c |   6 +++---
 sys/kern/tty.c      |  14 ++++++--------
 sys/sys/tty.h       |   4 ++--
 3 files changed, 11 insertions(+), 13 deletions(-)

diffs (103 lines):

diff -r 5233be9612de -r 21dcc661e042 sys/kern/subr_prf.c
--- a/sys/kern/subr_prf.c       Wed Apr 12 02:15:51 2023 +0000
+++ b/sys/kern/subr_prf.c       Wed Apr 12 06:35:26 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_prf.c,v 1.199 2023/04/09 09:18:09 riastradh Exp $ */
+/*     $NetBSD: subr_prf.c,v 1.200 2023/04/12 06:35:26 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.199 2023/04/09 09:18:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.200 2023/04/12 06:35:26 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -642,7 +642,7 @@ tprintf(tpr_t tpr, const char *fmt, ...)
        va_list ap;
 
        /* mutex_enter(&proc_lock); XXXSMP */
-       if (sess && sess->s_ttyvp && ttycheckoutq(sess->s_ttyp, 0)) {
+       if (sess && sess->s_ttyvp && ttycheckoutq(sess->s_ttyp)) {
                flags |= TOTTY;
                tp = sess->s_ttyp;
        }
diff -r 5233be9612de -r 21dcc661e042 sys/kern/tty.c
--- a/sys/kern/tty.c    Wed Apr 12 02:15:51 2023 +0000
+++ b/sys/kern/tty.c    Wed Apr 12 06:35:26 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty.c,v 1.309 2023/04/11 10:23:47 riastradh Exp $      */
+/*     $NetBSD: tty.c,v 1.310 2023/04/12 06:35:26 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.309 2023/04/11 10:23:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.310 2023/04/12 06:35:26 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2193,14 +2193,12 @@ ttread(struct tty *tp, struct uio *uio, 
  * Call with tty lock held.
  */
 static int
-ttycheckoutq_wlock(struct tty *tp, int wait)
+ttycheckoutq_wlock(struct tty *tp)
 {
        int     hiwat;
 
        KASSERT(mutex_owned(&tty_lock));
 
-       KASSERT(wait == 0);
-
        hiwat = tp->t_hiwat;
        if (tp->t_outq.c_cc > hiwat + 200)
                if (tp->t_outq.c_cc > hiwat) {
@@ -2212,12 +2210,12 @@ ttycheckoutq_wlock(struct tty *tp, int w
 }
 
 int
-ttycheckoutq(struct tty *tp, int wait)
+ttycheckoutq(struct tty *tp)
 {
        int     r;
 
        mutex_spin_enter(&tty_lock);
-       r = ttycheckoutq_wlock(tp, wait);
+       r = ttycheckoutq_wlock(tp);
        mutex_spin_exit(&tty_lock);
 
        return (r);
@@ -2801,7 +2799,7 @@ ttyputinfo(struct tty *tp, char *buf)
 
        KASSERT(mutex_owned(&tty_lock));
 
-       if (ttycheckoutq_wlock(tp, 0) == 0)
+       if (ttycheckoutq_wlock(tp) == 0)
                return;
        ttyprintf_nolock(tp, "%s\n", buf);
        tp->t_rocount = 0;      /* so pending input will be retyped if BS */
diff -r 5233be9612de -r 21dcc661e042 sys/sys/tty.h
--- a/sys/sys/tty.h     Wed Apr 12 02:15:51 2023 +0000
+++ b/sys/sys/tty.h     Wed Apr 12 06:35:26 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty.h,v 1.103 2022/10/26 23:41:49 riastradh Exp $      */
+/*     $NetBSD: tty.h,v 1.104 2023/04/12 06:35:26 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -285,7 +285,7 @@ int  ttstart(struct tty *);
 void    ttwakeup(struct tty *);
 int     ttwrite(struct tty *, struct uio *, int);
 void    ttychars(struct tty *);
-int     ttycheckoutq(struct tty *, int);
+int     ttycheckoutq(struct tty *);
 void    ttycancel(struct tty *);
 int     ttyclose(struct tty *);
 void    ttyflush(struct tty *, int);



Home | Main Index | Thread Index | Old Index