Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic com(4): Omit needless spltty in comstart.



details:   https://anonhg.NetBSD.org/src/rev/bc4ddf135a48
branches:  trunk
changeset: 371723:bc4ddf135a48
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Oct 03 19:59:21 2022 +0000

description:
com(4): Omit needless spltty in comstart.

This is called either via tp->t_oproc, which is done with tty_lock
held (thus, at IPL_VM = IPL_TTY), or from comparam which is called at
IPL_TTY, either via comopen or tp->t_param.

diffstat:

 sys/dev/ic/com.c |  15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diffs (50 lines):

diff -r 2e254671b8dc -r bc4ddf135a48 sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Mon Oct 03 19:58:48 2022 +0000
+++ b/sys/dev/ic/com.c  Mon Oct 03 19:59:21 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.376 2022/10/03 19:58:48 riastradh Exp $ */
+/* $NetBSD: com.c,v 1.377 2022/10/03 19:59:21 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.376 2022/10/03 19:58:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.377 2022/10/03 19:59:21 riastradh Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -1930,18 +1930,16 @@
        struct com_softc *sc =
            device_lookup_private(&com_cd, COMUNIT(tp->t_dev));
        struct com_regs *regsp = &sc->sc_regs;
-       int s;
 
        if (COM_ISALIVE(sc) == 0)
                return;
 
-       s = spltty();
        if (ISSET(tp->t_state, TS_BUSY | TS_TIMEOUT | TS_TTSTOP))
-               goto out;
+               return;
        if (sc->sc_tx_stopped)
-               goto out;
+               return;
        if (!ttypull(tp))
-               goto out;
+               return;
 
        /* Grab the first contiguous region of buffer space. */
        {
@@ -1979,9 +1977,6 @@
        }
 
        mutex_spin_exit(&sc->sc_lock);
-out:
-       splx(s);
-       return;
 }
 
 /*



Home | Main Index | Thread Index | Old Index