aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/ttydevsw.h
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2016-01-25 22:58:06 +0000
committerMarius Strobl <marius@FreeBSD.org>2016-01-25 22:58:06 +0000
commit57169cea64fa5fc82057b63149d56395665dd490 (patch)
tree20e508876d258a9d2b4c850f0d683e1a98359d0a /sys/sys/ttydevsw.h
parentfc2c2cd9e3f32daf40685ade050d5ab4e1e683e7 (diff)
downloadsrc-57169cea64fa5fc82057b63149d56395665dd490.tar.gz
src-57169cea64fa5fc82057b63149d56395665dd490.zip
- Make the code consistent with itself style-wise and bring it closer
to style(9). - Mark unused arguments as such. - Make the ttystates table const.
Notes
Notes: svn path=/head/; revision=294753
Diffstat (limited to 'sys/sys/ttydevsw.h')
-rw-r--r--sys/sys/ttydevsw.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/sys/sys/ttydevsw.h b/sys/sys/ttydevsw.h
index 876a3dd6d8d0..98bebca724dd 100644
--- a/sys/sys/ttydevsw.h
+++ b/sys/sys/ttydevsw.h
@@ -83,15 +83,17 @@ struct ttydevsw {
static __inline int
ttydevsw_open(struct tty *tp)
{
+
tty_lock_assert(tp, MA_OWNED);
MPASS(!tty_gone(tp));
- return tp->t_devsw->tsw_open(tp);
+ return (tp->t_devsw->tsw_open(tp));
}
static __inline void
ttydevsw_close(struct tty *tp)
{
+
tty_lock_assert(tp, MA_OWNED);
MPASS(!tty_gone(tp));
@@ -101,6 +103,7 @@ ttydevsw_close(struct tty *tp)
static __inline void
ttydevsw_outwakeup(struct tty *tp)
{
+
tty_lock_assert(tp, MA_OWNED);
MPASS(!tty_gone(tp));
@@ -114,6 +117,7 @@ ttydevsw_outwakeup(struct tty *tp)
static __inline void
ttydevsw_inwakeup(struct tty *tp)
{
+
tty_lock_assert(tp, MA_OWNED);
MPASS(!tty_gone(tp));
@@ -127,49 +131,56 @@ ttydevsw_inwakeup(struct tty *tp)
static __inline int
ttydevsw_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
{
+
tty_lock_assert(tp, MA_OWNED);
MPASS(!tty_gone(tp));
- return tp->t_devsw->tsw_ioctl(tp, cmd, data, td);
+ return (tp->t_devsw->tsw_ioctl(tp, cmd, data, td));
}
static __inline int
-ttydevsw_cioctl(struct tty *tp, int unit, u_long cmd, caddr_t data, struct thread *td)
+ttydevsw_cioctl(struct tty *tp, int unit, u_long cmd, caddr_t data,
+ struct thread *td)
{
+
tty_lock_assert(tp, MA_OWNED);
MPASS(!tty_gone(tp));
- return tp->t_devsw->tsw_cioctl(tp, unit, cmd, data, td);
+ return (tp->t_devsw->tsw_cioctl(tp, unit, cmd, data, td));
}
static __inline int
ttydevsw_param(struct tty *tp, struct termios *t)
{
+
MPASS(!tty_gone(tp));
- return tp->t_devsw->tsw_param(tp, t);
+ return (tp->t_devsw->tsw_param(tp, t));
}
static __inline int
ttydevsw_modem(struct tty *tp, int sigon, int sigoff)
{
+
MPASS(!tty_gone(tp));
- return tp->t_devsw->tsw_modem(tp, sigon, sigoff);
+ return (tp->t_devsw->tsw_modem(tp, sigon, sigoff));
}
static __inline int
ttydevsw_mmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr,
int nprot, vm_memattr_t *memattr)
{
+
MPASS(!tty_gone(tp));
- return tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot, memattr);
+ return (tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot, memattr));
}
static __inline void
ttydevsw_pktnotify(struct tty *tp, char event)
{
+
tty_lock_assert(tp, MA_OWNED);
MPASS(!tty_gone(tp));
@@ -179,6 +190,7 @@ ttydevsw_pktnotify(struct tty *tp, char event)
static __inline void
ttydevsw_free(struct tty *tp)
{
+
MPASS(tty_gone(tp));
tp->t_devsw->tsw_free(tty_softc(tp));