Am 10.01.2012 13:40, schrieb Peter Maydell: > On 23 December 2011 11:40, Evgeny Voevodin <e.voevo...@samsung.com> wrote: >> + >> +#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))) > > 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 = { >> + .qdev.name = "exynos4210.pwm", >> + .qdev.size = sizeof(struct Exynos4210PWMState), >> + .qdev.reset = exynos4210_pwm_reset, >> + .qdev.vmsd = &VMState_Exynos4210PWMState, >> + .init = exynos4210_pwm_init, >> + .qdev.props = (Property[]) { >> + DEFINE_PROP_END_OF_LIST(), >> + } > > 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 this. 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 -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg