On Fri, Apr 22, 2016 at 02:25:06PM +0300, Joonas Lahtinen wrote: > Move the better constructs/comments from i915_gem_stolen.c to > early-quirks.c and increase readability in preparation of only > having one set of functions. > > - intel_stolen_base -> gen3_stolen_base > - use phys_addr_t instead of u32 for address for future proofing > > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxx> > Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxxxxx> > Signed-off-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> Looks like a fairly mechanical change, so Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > static size_t __init i830_stolen_size(int num, int slot, int func) > { > - size_t stolen_size; > u16 gmch_ctrl; > + u16 gms; > > gmch_ctrl = read_pci_config_16(0, 0, 0, I830_GMCH_CTRL); > - > - switch (gmch_ctrl & I830_GMCH_GMS_MASK) { > - case I830_GMCH_GMS_STOLEN_512: > - stolen_size = KB(512); > - break; > - case I830_GMCH_GMS_STOLEN_1024: > - stolen_size = MB(1); > - break; > - case I830_GMCH_GMS_STOLEN_8192: > - stolen_size = MB(8); > - break; > - case I830_GMCH_GMS_LOCAL: > - /* local memory isn't part of the normal address space */ > - stolen_size = 0; > - break; > + gms = gmch_ctrl & I830_GMCH_GMS_MASK; > + > + switch (gms) { > + case I830_GMCH_GMS_STOLEN_512: return KB(512); > + case I830_GMCH_GMS_STOLEN_1024: return MB(1); > + case I830_GMCH_GMS_STOLEN_8192: return MB(8); > + /* local memory isn't part of the normal address space */ > + case I830_GMCH_GMS_LOCAL: return 0; > default: > - return 0; > + WARN(1, "Unknown register value!\n"); When adding a warn try to include the pertinent information: WARN(1, "Unknown I830_GMCH_CTRL value: %x!\n", gms); -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx