X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..bca245acd4c03fd752d1a45f011ad495e60fe53d:/bsd/dev/i386/cons.c diff --git a/bsd/dev/i386/cons.c b/bsd/dev/i386/cons.c index dbd46a1cc..8a9ee5255 100644 --- a/bsd/dev/i386/cons.c +++ b/bsd/dev/i386/cons.c @@ -2,7 +2,7 @@ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ @@ -55,7 +55,7 @@ #include #include -struct tty *constty; /* current console device */ +struct tty *constty; /* current console device */ /* * The km driver supplied the default console device for the systems @@ -76,17 +76,18 @@ int cnselect(__unused dev_t dev, int flag, void * wql, proc_t p); static dev_t cndev(void) { - if (constty) + if (constty) { return constty->t_dev; - else + } else { return km_tty[0]->t_dev; + } } int cnopen(__unused dev_t dev, int flag, int devtype, struct proc *pp) { dev = cndev(); - return ((*cdevsw[major(dev)].d_open)(dev, flag, devtype, pp)); + return (*cdevsw[major(dev)].d_open)(dev, flag, devtype, pp); } @@ -94,7 +95,7 @@ int cnclose(__unused dev_t dev, int flag, int mode, struct proc *pp) { dev = cndev(); - return ((*cdevsw[major(dev)].d_close)(dev, flag, mode, pp)); + return (*cdevsw[major(dev)].d_close)(dev, flag, mode, pp); } @@ -102,7 +103,7 @@ int cnread(__unused dev_t dev, struct uio *uio, int ioflag) { dev = cndev(); - return ((*cdevsw[major(dev)].d_read)(dev, uio, ioflag)); + return (*cdevsw[major(dev)].d_read)(dev, uio, ioflag); } @@ -110,7 +111,7 @@ int cnwrite(__unused dev_t dev, struct uio *uio, int ioflag) { dev = cndev(); - return ((*cdevsw[major(dev)].d_write)(dev, uio, ioflag)); + return (*cdevsw[major(dev)].d_write)(dev, uio, ioflag); } @@ -133,11 +134,11 @@ cnioctl(__unused dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) if (!error) { constty = NULL; } - return(error); + return error; } -#endif /* 0 */ +#endif /* 0 */ - return ((*cdevsw[major(dev)].d_ioctl)(dev, cmd, addr, flag, p)); + return (*cdevsw[major(dev)].d_ioctl)(dev, cmd, addr, flag, p); } @@ -145,5 +146,5 @@ int cnselect(__unused dev_t dev, int flag, void *wql, struct proc *p) { dev = cndev(); - return ((*cdevsw[major(dev)].d_select)(dev, flag, wql, p)); + return (*cdevsw[major(dev)].d_select)(dev, flag, wql, p); }