Module Name:    src
Committed By:   riastradh
Date:           Wed Oct 26 23:53:04 UTC 2022

Modified Files:
        src/sys/dev/usb: uhso.c

Log Message:
uhso(4): Convert locking comments to locking assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/uhso.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/uhso.c
diff -u src/sys/dev/usb/uhso.c:1.36 src/sys/dev/usb/uhso.c:1.37
--- src/sys/dev/usb/uhso.c:1.36	Sat Sep  3 02:48:00 2022
+++ src/sys/dev/usb/uhso.c	Wed Oct 26 23:53:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhso.c,v 1.36 2022/09/03 02:48:00 thorpej Exp $	*/
+/*	$NetBSD: uhso.c,v 1.37 2022/10/26 23:53:03 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2009 Iain Hibbert
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.36 2022/09/03 02:48:00 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.37 2022/10/26 23:53:03 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1759,7 +1759,6 @@ uhso_tty_do_ioctl(struct uhso_port *hp, 
 	return error;
 }
 
-/* this is called with tty_lock held */
 static void
 uhso_tty_stop(struct tty *tp, int flag)
 {
@@ -1768,6 +1767,8 @@ uhso_tty_stop(struct tty *tp, int flag)
 	    UHSOUNIT(tp->t_dev));
 	struct uhso_port *hp = sc->sc_port[UHSOPORT(tp->t_dev)];
 #endif
+
+	KASSERT(ttylocked(tp));
 }
 
 static struct tty *
@@ -1838,7 +1839,6 @@ uhso_tty_param(struct tty *tp, struct te
 	return 0;
 }
 
-/* this is called with tty_lock held */
 Static void
 uhso_tty_start(struct tty *tp)
 {
@@ -1847,6 +1847,8 @@ uhso_tty_start(struct tty *tp)
 	struct uhso_port *hp = sc->sc_port[UHSOPORT(tp->t_dev)];
 	int s;
 
+	KASSERT(ttylocked(tp));
+
 	if (!device_is_active(sc->sc_dev))
 		return;
 

Reply via email to