From eda20682cbcb0d12e5e4b5ee8133402d3a33fa5a Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Tue, 18 Aug 2020 12:14:01 +0000 Subject: [PATCH] iicmux: fix a sign error in comparison Because pcell_t is unsigned both sides of the comparison were treated as such. Because of that error iicmux created all possible sub-buses even if only a subset was defined in the device tree. MFC after: 1 week --- sys/dev/iicbus/mux/iicmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iicbus/mux/iicmux.c b/sys/dev/iicbus/mux/iicmux.c index a631f7642a5..f1454f440b0 100644 --- a/sys/dev/iicbus/mux/iicmux.c +++ b/sys/dev/iicbus/mux/iicmux.c @@ -283,7 +283,7 @@ iicmux_attach_children(struct iicmux_softc *sc) } sc->childdevs[idx] = device_add_child(sc->dev, "iicbus", -1); sc->childnodes[idx] = child; - if (sc->maxbus < idx) + if (sc->maxbus < (int)idx) sc->maxbus = idx; }