dma: axidma: Variablise repeated s->streams[i] sub-expr

This have 6 inline usages. Make it a bit more readable by using a local
variable.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
Peter Crosthwaite 2014-08-17 17:53:12 -07:00 committed by Michael Tokarev
parent f55f885267
commit 6a07a695b0

View File

@ -553,10 +553,12 @@ static void xilinx_axidma_realize(DeviceState *dev, Error **errp)
int i; int i;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
s->streams[i].nr = i; struct Stream *st = &s->streams[i];
s->streams[i].bh = qemu_bh_new(timer_hit, &s->streams[i]);
s->streams[i].ptimer = ptimer_init(s->streams[i].bh); st->nr = i;
ptimer_set_freq(s->streams[i].ptimer, s->freqhz); st->bh = qemu_bh_new(timer_hit, st);
st->ptimer = ptimer_init(st->bh);
ptimer_set_freq(st->ptimer, s->freqhz);
} }
return; return;