On 29 January 2017 at 11:53, Andrew Jones <drjones@xxxxxxxxxx> wrote: > On Mon, Jan 16, 2017 at 05:26:58PM +0800, Shannon Zhao wrote: >> From: Shannon Zhao <shannon.zhao@xxxxxxxxxx> >> + memset(id_regitsers, 0, ARM_CPU_ID_MAX * sizeof(struct kvm_one_reg)); >> + >> + id_regitsers[0].id = ARM64_SYS_REG(ARM_CPU_ID_MIDR); >> + id_regitsers[0].addr = (uintptr_t)&cpu->midr; >> + >> + id_regitsers[1].id = ARM64_SYS_REG(ARM_CPU_ID_REVIDR); >> + id_regitsers[1].addr = (uintptr_t)&cpu->revidr; >> + > > We can condense this nicely with list initialization > > struct kvm_one_reg id_regitsers[] = { > { ARM64_SYS_REG(ARM_CPU_ID_MIDR), (uintptr_t)&cpu->midr }, > { ARM64_SYS_REG(ARM_CPU_ID_REVIDR), (uintptr_t)&cpu->revidr }, > ... > { 0, 0 } "registers", please :-) thanks -- PMM _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm