From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJBCp-00079B-Tf for qemu-devel@nongnu.org; Sun, 17 Aug 2014 20:53:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJBCj-0002Jr-3E for qemu-devel@nongnu.org; Sun, 17 Aug 2014 20:53:51 -0400 Received: from mail-yk0-f169.google.com ([209.85.160.169]:50551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJBCi-0002Jh-VW for qemu-devel@nongnu.org; Sun, 17 Aug 2014 20:53:45 -0400 Received: by mail-yk0-f169.google.com with SMTP id 131so3791088ykp.0 for ; Sun, 17 Aug 2014 17:53:44 -0700 (PDT) Sender: Peter Crosthwaite From: Peter Crosthwaite Date: Sun, 17 Aug 2014 17:53:12 -0700 Message-Id: In-Reply-To: <737df733ddb4779e1dcb24b14d1b5d223509dce7.1408322869.git.peter.crosthwaite@xilinx.com> References: <737df733ddb4779e1dcb24b14d1b5d223509dce7.1408322869.git.peter.crosthwaite@xilinx.com> Subject: [Qemu-devel] [PATCH trivial v1 2/2] dma: axidma: Variablise repeated s->streams[i] sub-expr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, edgar.iglesias@xilinx.com This have 6 inline usages. Make it a bit more readable by using a local variable. Signed-off-by: Peter Crosthwaite --- Theres three more usages of this in coming patches, that would push the number of usages higher hw/dma/xilinx_axidma.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index ee60d3f..d06002d 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -553,10 +553,12 @@ static void xilinx_axidma_realize(DeviceState *dev, Error **errp) int i; for (i = 0; i < 2; i++) { - s->streams[i].nr = i; - s->streams[i].bh = qemu_bh_new(timer_hit, &s->streams[i]); - s->streams[i].ptimer = ptimer_init(s->streams[i].bh); - ptimer_set_freq(s->streams[i].ptimer, s->freqhz); + struct Stream *st = &s->streams[i]; + + st->nr = i; + st->bh = qemu_bh_new(timer_hit, st); + st->ptimer = ptimer_init(st->bh); + ptimer_set_freq(st->ptimer, s->freqhz); } return; -- 2.0.1.1.gfbfc394