From d449859ec8e33055036a5a7bb15bfe4f68282391 Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Sat, 2 Jan 2016 00:10:31 +0100 Subject: fix t_addr assignment in lpropen * i386/i386at/lpr.c (lpropen): Fix assignment to t_addr. --- i386/i386at/lpr.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'i386') diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c index edeef9f..73c4261 100644 --- a/i386/i386at/lpr.c +++ b/i386/i386at/lpr.c @@ -105,22 +105,24 @@ void lprattach(struct bus_device *dev) } int -lpropen(dev, flag, ior) -dev_t dev; -int flag; -io_req_t ior; +lpropen(dev_t dev, int flag, io_req_t ior) { -int unit = minor(dev); -struct bus_device *isai; -struct tty *tp; -u_short addr; - - if (unit >= NLPR || (isai = lprinfo[unit]) == 0 || isai->alive == 0) - return (D_NO_SUCH_DEVICE); + int unit = minor(dev); + struct bus_device *isai; + struct tty *tp; + u_short addr; + + if (unit >= NLPR) + return D_NO_SUCH_DEVICE; + + isai = lprinfo[unit]; + if (isai == NULL || !isai->alive) + return D_NO_SUCH_DEVICE; + tp = &lpr_tty[unit]; addr = (u_short) isai->address; tp->t_dev = dev; - tp->t_addr = *(caddr_t *)&addr; + tp->t_addr = addr; tp->t_oproc = lprstart; tp->t_state |= TS_WOPEN; tp->t_stop = lprstop; -- cgit v1.2.3