From 940e3165d31370871e66e0ae2cce13f010cb26ba Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 3 Jul 2022 12:10:27 +0000 Subject: [PATCH] imx8: less stupid pci interrupt handler --- sys/src/9/imx8/pciimx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/src/9/imx8/pciimx.c b/sys/src/9/imx8/pciimx.c index a18b07c9b..fbfca1546 100644 --- a/sys/src/9/imx8/pciimx.c +++ b/sys/src/9/imx8/pciimx.c @@ -248,7 +248,7 @@ pciinterrupt(Ureg *ureg, void *arg) { Ctlr *ctlr = arg; Intvec *vec; - u32int status, mask; + u32int status; status = ctlr->dbi[MSI_CTRL_INT_0_STATUS]; if(status == 0) @@ -256,8 +256,8 @@ pciinterrupt(Ureg *ureg, void *arg) ctlr->dbi[MSI_CTRL_INT_0_STATUS] = status; ilock(ctlr); - for(vec = ctlr->vec, mask = 1; vec < &ctlr->vec[nelem(ctlr->vec)]; vec++, mask <<= 1){ - if((status & mask) != 0 && vec->f != nil) + for(vec = ctlr->vec; status != 0 && vec < &ctlr->vec[nelem(ctlr->vec)]; vec++, status >>= 1){ + if((status & 1) != 0 && vec->f != nil) (*vec->f)(ureg, vec->a); } iunlock(ctlr);