From cf8183f367d3d5699180fb0483affbe56a3b388d Mon Sep 17 00:00:00 2001 From: anton Date: Thu, 25 Nov 2021 20:31:24 +0000 Subject: [PATCH] revert recent change, breakage reported by dv@ --- sys/dev/usb/uhidev.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index 2d741b85f2e..3d9d2b56164 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.104 2021/11/25 06:25:32 anton Exp $ */ +/* $OpenBSD: uhidev.c,v 1.105 2021/11/25 20:31:24 anton Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -256,21 +256,16 @@ uhidev_attach(struct device *parent, struct device *self, void *aux) /* Look for a driver claiming multiple report IDs first. */ dev = config_found_sm(self, &uha, NULL, NULL); if (dev != NULL) { - int nclaimed = 0; - for (repid = 0; repid < nrepid; repid++) { - if (!uha.claimed[repid]) - continue; - - nclaimed++; /* * Could already be assigned by uhidev_set_report_dev(). */ if (sc->sc_subdevs[repid] != NULL) + continue; + + if (uha.claimed[repid]) sc->sc_subdevs[repid] = (struct uhidev *)dev; } - KASSERTMSG(nclaimed > 0, "%s did not claim any report ids", - dev->dv_xname); } free(uha.claimed, M_TEMP, nrepid); -- 2.20.1