On Tue, Mar 07, 2017 at 11:09:36AM +0000, Michal Wajdeczko wrote: > Manual pointer manipulation is error prone. Let compiler calculate > right offsets for us in case we need to change ads layout. > > v2: don't call it object (Chris) > > Signed-off-by: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx> > Cc: Oscar Mateo <oscar.mateo@xxxxxxxxx> > Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@xxxxxxxxx> > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Looks good. I would have done mine line splitting slightly differently. For > - ads->reg_state_buffer = ads->reg_state_addr + > - sizeof(struct guc_mmio_reg_state); > + blob->ads.reg_state_buffer = offset + > + offsetof(struct __guc_ads_blob, reg_state_buffer); I would have used blob->ads.reg_state_buffer = offset + offsetof(struct __guc_ads_blob, reg_state_buffer); I didn't see any mistakes in the conversion, and the packing is certainly more obvious now. Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx