[Intel-gfx] [PATCH 4/8] drm/i915/uc: Rename intel_?uc_init() to intel_?uc_fetch_fw()

Arkadiusz Hiler arkadiusz.hiler at intel.com
Tue Feb 21 11:37:02 UTC 2017


On Fri, Feb 17, 2017 at 02:31:09PM +0100, Michal Wajdeczko wrote:
> On Fri, Feb 17, 2017 at 02:05:53PM +0100, Arkadiusz Hiler wrote:
> > Trying to have subject_verb_object ordering and more descriptive names,
> > the intel_huc_init() and intel_guc_init() functions are renamed:
> > 
> >  * `intel_guc` is the subject, so those functions now take intel_guc
> >    structure, instead of the dev_priv
> >  * fetch is the verb
> >  * fw is the object which better describes the function's role
> > 
> > Same change is done for the huc counterpart.
> > 
> > Also we bulk call both functions from higher-level intel_fetch_uc_fw:
> >  * intel being the subject (taking the dev_priv as param)
> >  * fetch being the verb
> >  * uc_fw being the subject
> > 
> > Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> > Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> > Cc: Michal Winiarski <michal.winiarski at intel.com>
> > Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> > ---
> 
> <SNIP>
> 
> > diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
> > index 41b7351..19b8966 100644
> > --- a/drivers/gpu/drm/i915/intel_uc.h
> > +++ b/drivers/gpu/drm/i915/intel_uc.h
> > @@ -185,11 +185,12 @@ struct intel_huc {
> >  
> >  /* intel_uc.c */
> >  void intel_uc_init_early(struct drm_i915_private *dev_priv);
> > +void intel_fetch_uc_fw(struct drm_i915_private *dev_priv);
> 
> Hmm, names of these two functions above are inconsistent now.
> Maybe they both should start with i915 as they take dev_priv:
> 
> 	void i915_uc_init_early(struct drm_i915_private *dev_priv);
> 	void i915_uc_fetch_fw(struct drm_i915_private *dev_priv);

I had similar idea. I've asked on IRC on friday and general tendency is
to use intel_ for driver internals and i915_ for anything user farcing.

So, sadly, this is not a solution.

> or treat intel_uc as a subject:
> 
> 	void intel_uc_init_early(struct drm_i915_private *dev_priv);
> 	void intel_uc_fetch_fw(struct drm_i915_private *dev_priv);

It's still not quite there as it suggests that it acts on struct
intel_uc, but I'll go with it.

-- 
Cheers,
Arek


More information about the Intel-gfx mailing list