From 37d4c2e93b2a8d3ff54aadbafdd057ba4844d410 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Wed, 3 Mar 2004 21:47:40 +0000 Subject: The socket number diagnostic check was simply crying out for unsigned arithmetic... --- sys/dev/sbus/stp4020.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/sbus/stp4020.c b/sys/dev/sbus/stp4020.c index 6617591db46..c9617ad0264 100644 --- a/sys/dev/sbus/stp4020.c +++ b/sys/dev/sbus/stp4020.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stp4020.c,v 1.11 2004/03/02 23:10:18 miod Exp $ */ +/* $OpenBSD: stp4020.c,v 1.12 2004/03/03 21:47:39 miod Exp $ */ /* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem Exp $ */ /*- @@ -308,7 +308,8 @@ stp4020_event_thread(arg) void *arg; { struct stp4020_softc *sc = arg; - int s, sense, socket; + int s, sense; + unsigned int socket; for (;;) { struct stp4020_socket *h; @@ -323,7 +324,7 @@ stp4020_event_thread(arg) sc->events &= ~(1 << socket); splx(s); - if (socket < 0 || socket >= STP4020_NSOCK) { + if (socket >= STP4020_NSOCK) { #ifdef DEBUG printf("stp4020_event_thread: wayward socket number %d\n", socket); -- cgit v1.2.3