From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5zCW-00063r-0X for qemu-devel@nongnu.org; Sun, 04 Aug 2013 10:22:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5zCN-0000hs-5u for qemu-devel@nongnu.org; Sun, 04 Aug 2013 10:22:27 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48092 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5zCM-0000hV-TB for qemu-devel@nongnu.org; Sun, 04 Aug 2013 10:22:19 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 4 Aug 2013 16:22:09 +0200 Message-Id: <1375626131-6857-4-git-send-email-afaerber@suse.de> In-Reply-To: <1375626131-6857-1-git-send-email-afaerber@suse.de> References: <1375626131-6857-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-next for-next 3/5] microdrive: Coding Style cleanups List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Othmar Pasteka , Markus Armbruster , =?UTF-8?q?Andreas=20F=C3=A4rber?= Add missing braces. Signed-off-by: Andreas F=C3=A4rber --- hw/ide/microdrive.c | 62 ++++++++++++++++++++++++++++++++---------------= ------ 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index 0b53649..9e4ee9c 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -103,10 +103,12 @@ static inline void md_interrupt_update(MicroDriveSt= ate *s) static void md_set_irq(void *opaque, int irq, int level) { MicroDriveState *s =3D opaque; - if (level) + + if (level) { s->stat |=3D STAT_INT; - else + } else { s->stat &=3D ~STAT_INT; + } =20 md_interrupt_update(s); } @@ -142,10 +144,11 @@ static uint8_t md_attr_read(PCMCIACardState *card, = uint32_t at) case 0x00: /* Configuration Option Register */ return s->opt; case 0x02: /* Card Configuration Status Register */ - if (s->ctrl & CTRL_IEN) + if (s->ctrl & CTRL_IEN) { return s->stat & ~STAT_INT; - else + } else { return s->stat; + } case 0x04: /* Pin Replacement Register */ return (s->pins & PINS_CRDY) | 0x0c; case 0x06: /* Socket and Copy Register */ @@ -174,8 +177,9 @@ static void md_attr_write(PCMCIACardState *card, uint= 32_t at, uint8_t value) md_interrupt_update(s); break; case 0x02: /* Card Configuration Status Register */ - if ((s->stat ^ value) & STAT_PWRDWN) + if ((s->stat ^ value) & STAT_PWRDWN) { s->pins |=3D PINS_CRDY; + } s->stat &=3D 0x82; s->stat |=3D value & 0x74; md_interrupt_update(s); @@ -201,23 +205,26 @@ static uint16_t md_common_read(PCMCIACardState *car= d, uint32_t at) =20 switch (s->opt & OPT_MODE) { case OPT_MODE_MMAP: - if ((at & ~0x3ff) =3D=3D 0x400) + if ((at & ~0x3ff) =3D=3D 0x400) { at =3D 0; + } break; case OPT_MODE_IOMAP16: at &=3D 0xf; break; case OPT_MODE_IOMAP1: - if ((at & ~0xf) =3D=3D 0x3f0) + if ((at & ~0xf) =3D=3D 0x3f0) { at -=3D 0x3e8; - else if ((at & ~0xf) =3D=3D 0x1f0) + } else if ((at & ~0xf) =3D=3D 0x1f0) { at -=3D 0x1f0; + } break; case OPT_MODE_IOMAP2: - if ((at & ~0xf) =3D=3D 0x370) + if ((at & ~0xf) =3D=3D 0x370) { at -=3D 0x368; - else if ((at & ~0xf) =3D=3D 0x170) + } else if ((at & ~0xf) =3D=3D 0x170) { at -=3D 0x170; + } } =20 switch (at) { @@ -226,9 +233,9 @@ static uint16_t md_common_read(PCMCIACardState *card,= uint32_t at) return ide_data_readw(&s->bus, 0); =20 /* TODO: 8-bit accesses */ - if (s->cycle) + if (s->cycle) { ret =3D s->io >> 8; - else { + } else { s->io =3D ide_data_readw(&s->bus, 0); ret =3D s->io & 0xff; } @@ -240,10 +247,11 @@ static uint16_t md_common_read(PCMCIACardState *car= d, uint32_t at) return ide_ioport_read(&s->bus, 0x1); case 0xe: /* Alternate Status */ ifs =3D idebus_active_if(&s->bus); - if (ifs->bs) + if (ifs->bs) { return ifs->status; - else + } else { return 0; + } case 0xf: /* Device Address */ ifs =3D idebus_active_if(&s->bus); return 0xc2 | ((~ifs->select << 2) & 0x3c); @@ -261,23 +269,26 @@ static void md_common_write(PCMCIACardState *card, = uint32_t at, uint16_t value) =20 switch (s->opt & OPT_MODE) { case OPT_MODE_MMAP: - if ((at & ~0x3ff) =3D=3D 0x400) + if ((at & ~0x3ff) =3D=3D 0x400) { at =3D 0; + } break; case OPT_MODE_IOMAP16: at &=3D 0xf; break; case OPT_MODE_IOMAP1: - if ((at & ~0xf) =3D=3D 0x3f0) + if ((at & ~0xf) =3D=3D 0x3f0) { at -=3D 0x3e8; - else if ((at & ~0xf) =3D=3D 0x1f0) + } else if ((at & ~0xf) =3D=3D 0x1f0) { at -=3D 0x1f0; + } break; case OPT_MODE_IOMAP2: - if ((at & ~0xf) =3D=3D 0x370) + if ((at & ~0xf) =3D=3D 0x370) { at -=3D 0x368; - else if ((at & ~0xf) =3D=3D 0x170) + } else if ((at & ~0xf) =3D=3D 0x170) { at -=3D 0x170; + } } =20 switch (at) { @@ -287,10 +298,11 @@ static void md_common_write(PCMCIACardState *card, = uint32_t at, uint16_t value) break; =20 /* TODO: 8-bit accesses */ - if (s->cycle) + if (s->cycle) { ide_data_writew(&s->bus, 0, s->io | (value << 8)); - else + } else { s->io =3D value & 0xff; + } s->cycle =3D !s->cycle; break; case 0x9: @@ -546,8 +558,10 @@ static int dscm1xxxx_detach(PCMCIACardState *card) =20 PCMCIACardState *dscm1xxxx_init(DriveInfo *dinfo) { - MicroDriveState *md =3D MICRODRIVE(object_new(TYPE_DSCM1XXXX)); - PCMCIACardState *card =3D PCMCIA_CARD(md); + MicroDriveState *md; + + md =3D MICRODRIVE(object_new(TYPE_DSCM1XXXX)); + qdev_init_nofail(DEVICE(md)); =20 if (dinfo !=3D NULL) { ide_create_drive(&md->bus, 0, dinfo); @@ -556,7 +570,7 @@ PCMCIACardState *dscm1xxxx_init(DriveInfo *dinfo) md->bus.ifs[0].mdata_size =3D METADATA_SIZE; md->bus.ifs[0].mdata_storage =3D (uint8_t *) g_malloc0(METADATA_SIZE= ); =20 - return card; + return PCMCIA_CARD(md); } =20 static void dscm1xxxx_class_init(ObjectClass *oc, void *data) --=20 1.8.1.4