From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkc3Z-0003NW-Hg for qemu-devel@nongnu.org; Tue, 10 Jan 2012 08:48:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rkc3T-0006VC-ID for qemu-devel@nongnu.org; Tue, 10 Jan 2012 08:48:05 -0500 Received: from cantor2.suse.de ([195.135.220.15]:52889 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkc3T-0006Uy-56 for qemu-devel@nongnu.org; Tue, 10 Jan 2012 08:47:59 -0500 Message-ID: <4F0C4128.7070304@suse.de> Date: Tue, 10 Jan 2012 14:46:16 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1324640414-16000-1-git-send-email-e.voevodin@samsung.com> <1324640414-16000-6-git-send-email-e.voevodin@samsung.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v5 05/11] ARM: exynos4210: PWM support. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Evgeny Voevodin Cc: Peter Maydell , qemu-devel@nongnu.org, kyungmin.park@samsung.com, d.solodkiy@samsung.com, m.kozlov@samsung.com, jehyung.lee@samsung.com Am 10.01.2012 13:40, schrieb Peter Maydell: > On 23 December 2011 11:40, Evgeny Voevodin wro= te: >> + >> +#define TCNTB(x) (0xC*x) >> +#define TCMPB(x) (0xC*x+1) >> +#define TCNTO(x) (0xC*x+2) >> + >> +#define GET_PRESCALER(reg, x) ((reg&(0xFF<<(8*x)))>>8*x) >> +#define GET_DIVIDER(reg, x) (1<<((0xF<<(4*x))>>(4*x))) >=20 > These macros (and the ones below) brackets around arguments (ie "(x)") > to avoid operator precedence issues. And add the usual spaces around operators for readability, please. >> +static SysBusDeviceInfo exynos4210_pwm_info =3D { >> + .qdev.name =3D "exynos4210.pwm", >> + .qdev.size =3D sizeof(struct Exynos4210PWMState), >> + .qdev.reset =3D exynos4210_pwm_reset, >> + .qdev.vmsd =3D &VMState_Exynos4210PWMState, >> + .init =3D exynos4210_pwm_init, >> + .qdev.props =3D (Property[]) { >> + DEFINE_PROP_END_OF_LIST(), >> + } >=20 > If you don't have any properties, you don't need to set .qdev.props > at all -- there's no need to explicitly write out an empty list like th= is. For qdev, that's a matter of taste (I usually add empty lists myself). With QOM that leads to a named static array with one NULL entry that can be avoided by following Peter's suggestion. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg