From: kettenis Date: Thu, 7 Oct 2021 13:34:20 +0000 (+0000) Subject: Use correct index variable. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=55406a377c3df91a46389eacc963ba3dc8373983;p=openbsd Use correct index variable. pointed out by patrick@ (with the help of clang) ok patrick@ --- diff --git a/sys/arch/arm64/dev/aplpcie.c b/sys/arch/arm64/dev/aplpcie.c index 599fd04fa61..17af9b11815 100644 --- a/sys/arch/arm64/dev/aplpcie.c +++ b/sys/arch/arm64/dev/aplpcie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplpcie.c,v 1.6 2021/09/09 22:46:03 kettenis Exp $ */ +/* $OpenBSD: aplpcie.c,v 1.7 2021/10/07 13:34:20 kettenis Exp $ */ /* * Copyright (c) 2021 Mark Kettenis * @@ -155,8 +155,8 @@ aplpcie_attach(struct device *parent, struct device *self, void *aux) idx = OF_getindex(faa->fa_node, "config", "reg-names"); if (idx < 0 || idx >= faa->fa_nreg || - bus_space_map(sc->sc_iot, faa->fa_reg[i].addr, - faa->fa_reg[i].size, 0, &sc->sc_ioh)) { + bus_space_map(sc->sc_iot, faa->fa_reg[idx].addr, + faa->fa_reg[idx].size, 0, &sc->sc_ioh)) { printf(": can't map registers\n"); return; }