diff mbox

[2/2] drm/i915: Rename assert_forcewakes_inactive

Message ID 20170509073609.35420-2-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Wajdeczko May 9, 2017, 7:36 a.m. UTC
All other functions related to uncore start with intel_uncore prefix.
Follow that pattern.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c     | 2 +-
 drivers/gpu/drm/i915/intel_uncore.c | 4 ++--
 drivers/gpu/drm/i915/intel_uncore.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Mika Kuoppala May 9, 2017, 8:53 a.m. UTC | #1
Michal Wajdeczko <michal.wajdeczko@intel.com> writes:

> All other functions related to uncore start with intel_uncore prefix.
> Follow that pattern.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.c     | 2 +-
>  drivers/gpu/drm/i915/intel_uncore.c | 4 ++--
>  drivers/gpu/drm/i915/intel_uncore.h | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 72fb47a..4a3cb11 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -2432,7 +2432,7 @@ static int intel_runtime_suspend(struct device *kdev)
>  		intel_opregion_notify_adapter(dev_priv, PCI_D1);
>  	}
>  
> -	assert_forcewakes_inactive(dev_priv);
> +	intel_uncore_assert_forcewakes_inactive(dev_priv);
>  
>  	if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv))
>  		intel_hpd_poll_init(dev_priv);
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 2c628df..b5ded2c 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -287,7 +287,7 @@ static void intel_uncore_forcewake_reset(struct drm_i915_private *dev_priv,
>  	}
>  
>  	if (!restore)
> -		assert_forcewakes_inactive(dev_priv);
> +		intel_uncore_assert_forcewakes_inactive(dev_priv);
>  
>  	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
>  }
> @@ -565,7 +565,7 @@ void intel_uncore_forcewake_put__locked(struct drm_i915_private *dev_priv,
>  	__intel_uncore_forcewake_put(dev_priv, fw_domains);
>  }
>  
> -void assert_forcewakes_inactive(struct drm_i915_private *dev_priv)
> +void intel_uncore_assert_forcewakes_inactive(struct drm_i915_private *dev_priv)
>  {
>  	if (!dev_priv->uncore.funcs.force_wake_get)
>  		return;
> diff --git a/drivers/gpu/drm/i915/intel_uncore.h b/drivers/gpu/drm/i915/intel_uncore.h
> index cced6b7..35fcdfb 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.h
> +++ b/drivers/gpu/drm/i915/intel_uncore.h
> @@ -128,7 +128,7 @@ void intel_uncore_suspend(struct drm_i915_private *dev_priv);
>  void intel_uncore_resume_early(struct drm_i915_private *dev_priv);
>  
>  u64 intel_uncore_edram_size(struct drm_i915_private *dev_priv);
> -void assert_forcewakes_inactive(struct drm_i915_private *dev_priv);
> +void intel_uncore_assert_forcewakes_inactive(struct drm_i915_private *dev_priv);
>  const char *intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id);
>  
>  enum forcewake_domains
> -- 
> 2.7.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson May 9, 2017, 10:09 a.m. UTC | #2
On Tue, May 09, 2017 at 07:36:09AM +0000, Michal Wajdeczko wrote:
> All other functions related to uncore start with intel_uncore prefix.
> Follow that pattern.

Debatable. Fwiw, we use the assert_*() pattern frequently because that
"it's a debug only function" is important to make it the first word.
-Chris
Michal Wajdeczko May 9, 2017, 10:20 a.m. UTC | #3
On Tue, May 09, 2017 at 11:09:58AM +0100, Chris Wilson wrote:
> On Tue, May 09, 2017 at 07:36:09AM +0000, Michal Wajdeczko wrote:
> > All other functions related to uncore start with intel_uncore prefix.
> > Follow that pattern.
> 
> Debatable. Fwiw, we use the assert_*() pattern frequently because that
> "it's a debug only function" is important to make it the first word.

But most of our assert_*() functions are declared as static, so they don't count.
I think in case of public functions, we should follow object/verb pattern.
Note that there is lockdep_assert_held() not assert_lockdep_held().

-Michal
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 72fb47a..4a3cb11 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -2432,7 +2432,7 @@  static int intel_runtime_suspend(struct device *kdev)
 		intel_opregion_notify_adapter(dev_priv, PCI_D1);
 	}
 
-	assert_forcewakes_inactive(dev_priv);
+	intel_uncore_assert_forcewakes_inactive(dev_priv);
 
 	if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv))
 		intel_hpd_poll_init(dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 2c628df..b5ded2c 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -287,7 +287,7 @@  static void intel_uncore_forcewake_reset(struct drm_i915_private *dev_priv,
 	}
 
 	if (!restore)
-		assert_forcewakes_inactive(dev_priv);
+		intel_uncore_assert_forcewakes_inactive(dev_priv);
 
 	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 }
@@ -565,7 +565,7 @@  void intel_uncore_forcewake_put__locked(struct drm_i915_private *dev_priv,
 	__intel_uncore_forcewake_put(dev_priv, fw_domains);
 }
 
-void assert_forcewakes_inactive(struct drm_i915_private *dev_priv)
+void intel_uncore_assert_forcewakes_inactive(struct drm_i915_private *dev_priv)
 {
 	if (!dev_priv->uncore.funcs.force_wake_get)
 		return;
diff --git a/drivers/gpu/drm/i915/intel_uncore.h b/drivers/gpu/drm/i915/intel_uncore.h
index cced6b7..35fcdfb 100644
--- a/drivers/gpu/drm/i915/intel_uncore.h
+++ b/drivers/gpu/drm/i915/intel_uncore.h
@@ -128,7 +128,7 @@  void intel_uncore_suspend(struct drm_i915_private *dev_priv);
 void intel_uncore_resume_early(struct drm_i915_private *dev_priv);
 
 u64 intel_uncore_edram_size(struct drm_i915_private *dev_priv);
-void assert_forcewakes_inactive(struct drm_i915_private *dev_priv);
+void intel_uncore_assert_forcewakes_inactive(struct drm_i915_private *dev_priv);
 const char *intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id);
 
 enum forcewake_domains