Module Name:    src
Committed By:   martin
Date:           Fri Sep 20 10:20:56 UTC 2024

Modified Files:
        src/sys/dev/usb [netbsd-10]: ucom.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #877):

        sys/dev/usb/ucom.c: revision 1.138

ucom(4): Simplify logic fixing PR kern/57259.
cv_timedwait only ever returns 0 or EWOULDBLOCK, so this would always
return ERESTART anyway.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.134.2.2 -r1.134.2.3 src/sys/dev/usb/ucom.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/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.134.2.2 src/sys/dev/usb/ucom.c:1.134.2.3
--- src/sys/dev/usb/ucom.c:1.134.2.2	Tue Mar  7 19:52:01 2023
+++ src/sys/dev/usb/ucom.c	Fri Sep 20 10:20:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.134.2.2 2023/03/07 19:52:01 martin Exp $	*/
+/*	$NetBSD: ucom.c,v 1.134.2.3 2024/09/20 10:20:56 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.134.2.2 2023/03/07 19:52:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.134.2.3 2024/09/20 10:20:56 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -552,14 +552,10 @@ ucomopen(dev_t dev, int flag, int mode, 
 			ms = MIN(INT_MAX - 1000, delta.tv_sec*1000);
 			ms += howmany(delta.tv_usec, 1000);
 			ticks = MAX(1, MIN(INT_MAX, mstohz(ms)));
-			error = cv_timedwait(&sc->sc_statecv, &sc->sc_lock,
+			(void)cv_timedwait(&sc->sc_statecv, &sc->sc_lock,
 			    ticks);
 			mutex_exit(&sc->sc_lock);
-			/* The successful passage of time is not an error. */
-			if (error == EWOULDBLOCK) {
-				error = 0;
-			}
-			return error ? error : ERESTART;
+			return ERESTART;
 		}
 		timerclear(&sc->sc_hup_time);
 	}

Reply via email to