[Intel-gfx] [PATCH v3 4/4] drm/i915: rename i915_init_power_well to i915_init_power_domains

Daniel Vetter daniel at ffwll.ch
Sun Oct 27 13:44:17 CET 2013


On Fri, Oct 25, 2013 at 06:10:31PM -0200, Paulo Zanoni wrote:
> 2013/10/25 Imre Deak <imre.deak at intel.com>:
> > Similarly rename the other related functions in the power domain
> > interface.
> >
> > Higher level driver code calling these functions knows only about power
> > domains, not the underlying power wells which may be different on
> > different platforms. Also these functions really init/cleanup/resume
> > power domains and only through that all related power wells, so rename
> > them accordingly.
> >
> > Signed-off-by: Imre Deak <imre.deak at intel.com>
> 
> I agree with the "_domains" rename, I think it's an improvement, but
> since you're already renaming things, I have to drop my bikeshed: we
> have intel_init_power_{well,domains} and
> i915_init_power_{well,domains}. IMHO this is really super annoyingly
> confusing, because they sound like they do the same thing. I know it's
> not your fault, but while you're at it, could you please propose names
> to unconfuse this?
> 
> i915_init_power_well takes care of initializing the structs and
> pointers, while intel_init_power_well is the only one that touches
> hardware. A possible suggestion:
> 
> - i915_init_power_well becomes intel_init_power_domains (just because
> I don't like the "i915_" prefix, since the PM code uses "intel_" for
> everything).
> - i915_remove_power_well becomes intel_remove_power_domains (to match
> the one above)
> - intel_init_power_well becomes intel_init_power_domains_hardware or
> intel_init_power_wells (since on the HW these things are actually
> called "power wells") or intel_init_hw_power_wells (to combine both
> suggestions)

The pattern we have thus far is $prefix_$block_init and
$prefix_$block_init_hw. Occasionally the $block is at the end, but for
cases where we have both an init and an init_hw function I think putting
the init[_hw] at the end to make it stick out more is better.

Just my 2 bikesheds ;-)
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list