usbxhci: simplify xecp()

This commit is contained in:
cinap_lenrek 2017-07-29 01:12:32 +02:00
parent c74538a67e
commit cd108e2f0b

View file

@ -317,22 +317,20 @@ xecp(Ctlr *ctlr, uchar id, u32int *p)
{ {
u32int x; u32int x;
if(p != nil) { if(p == nil){
x = *p; p = ctlr->mmio;
goto Next;
}
x = ctlr->hccparams>>16; x = ctlr->hccparams>>16;
if(x == 0) } else
return nil; x = (*p>>8) & 255;
p = ctlr->mmio + x; while(x != 0){
while(((x = *p) & 255) != id){
Next:
x >>= 8, x &= 255;
if(x == 0)
return nil;
p += x; p += x;
} x = *p;
if((x & 255) == id)
return p; return p;
x >>= 8;
x &= 255;
}
return nil;
} }
static void static void