From ee531086caca48de570403be1cef2fde25c75cbc Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Wed, 23 Jun 2004 10:28:09 +0000 Subject: save a few redundant lines by moving the retry loop further backwards. --- sys/dev/uart/uart_tty.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'sys/dev/uart') diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c index ec1069666641b..e1c84682577a7 100644 --- a/sys/dev/uart/uart_tty.c +++ b/sys/dev/uart/uart_tty.c @@ -367,13 +367,13 @@ uart_tty_open(struct cdev *dev, int flags, int mode, struct thread *td) struct tty *tp; int error; + loop: sc = dev->si_drv1; if (sc == NULL || sc->sc_leaving) return (ENODEV); tp = dev->si_tty; - loop: if (sc->sc_opened) { KASSERT(tp->t_state & TS_ISOPEN, ("foo")); /* @@ -390,9 +390,6 @@ uart_tty_open(struct cdev *dev, int flags, int mode, struct thread *td) error = tsleep(sc, TTIPRI|PCATCH, "uartbi", 0); if (error) return (error); - sc = dev->si_drv1; - if (sc == NULL || sc->sc_leaving) - return (ENODEV); goto loop; } } @@ -432,9 +429,6 @@ uart_tty_open(struct cdev *dev, int flags, int mode, struct thread *td) error = tsleep(TSA_CARR_ON(tp), TTIPRI|PCATCH, "uartdcd", 0); if (error) return (error); - sc = dev->si_drv1; - if (sc == NULL || sc->sc_leaving) - return (ENODEV); goto loop; } error = ttyopen(dev, tp); -- cgit v1.3