diff mbox series

[08/10] drm/i915/crt: Drop pointless drm_device variables

Message ID 20241107161123.16269-9-ville.syrjala@linux.intel.com (mailing list archive)
State New
Headers show
Series drm/i915: Potential boot oops fix and some cleanups | expand

Commit Message

Ville Syrjala Nov. 7, 2024, 4:11 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Remove a bunch of pointless 'struct drm_device *dev' local variables.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_crt.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Comments

Jani Nikula Nov. 8, 2024, 1:15 p.m. UTC | #1
On Thu, 07 Nov 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Remove a bunch of pointless 'struct drm_device *dev' local variables.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_crt.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c
> index 0962a239288b..5c3c6bc16a9e 100644
> --- a/drivers/gpu/drm/i915/display/intel_crt.c
> +++ b/drivers/gpu/drm/i915/display/intel_crt.c
> @@ -364,8 +364,7 @@ intel_crt_mode_valid(struct drm_connector *connector,
>  		     struct drm_display_mode *mode)
>  {
>  	struct intel_display *display = to_intel_display(connector->dev);
> -	struct drm_device *dev = connector->dev;
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct drm_i915_private *dev_priv = to_i915(connector->dev);

Might've used to_i915(display->drm) but doesn't matter, this will go
away eventually anyway.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>  	int max_dotclk = display->cdclk.max_dotclk_freq;
>  	enum drm_mode_status status;
>  	int max_clock;
> @@ -490,9 +489,8 @@ static int hsw_crt_compute_config(struct intel_encoder *encoder,
>  static bool ilk_crt_detect_hotplug(struct drm_connector *connector)
>  {
>  	struct intel_display *display = to_intel_display(connector->dev);
> -	struct drm_device *dev = connector->dev;
>  	struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector));
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct drm_i915_private *dev_priv = to_i915(connector->dev);
>  	u32 adpa;
>  	bool ret;
>  
> @@ -541,9 +539,8 @@ static bool ilk_crt_detect_hotplug(struct drm_connector *connector)
>  static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
>  {
>  	struct intel_display *display = to_intel_display(connector->dev);
> -	struct drm_device *dev = connector->dev;
>  	struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector));
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct drm_i915_private *dev_priv = to_i915(connector->dev);
>  	bool reenable_hpd;
>  	u32 adpa;
>  	bool ret;
> @@ -597,8 +594,7 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
>  static bool intel_crt_detect_hotplug(struct drm_connector *connector)
>  {
>  	struct intel_display *display = to_intel_display(connector->dev);
> -	struct drm_device *dev = connector->dev;
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct drm_i915_private *dev_priv = to_i915(connector->dev);
>  	u32 stat;
>  	bool ret = false;
>  	int i, tries = 0;
> @@ -956,8 +952,7 @@ intel_crt_detect(struct drm_connector *connector,
>  static int intel_crt_get_modes(struct drm_connector *connector)
>  {
>  	struct intel_display *display = to_intel_display(connector->dev);
> -	struct drm_device *dev = connector->dev;
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct drm_i915_private *dev_priv = to_i915(connector->dev);
>  	struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector));
>  	struct intel_encoder *intel_encoder = &crt->base;
>  	intel_wakeref_t wakeref;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c
index 0962a239288b..5c3c6bc16a9e 100644
--- a/drivers/gpu/drm/i915/display/intel_crt.c
+++ b/drivers/gpu/drm/i915/display/intel_crt.c
@@ -364,8 +364,7 @@  intel_crt_mode_valid(struct drm_connector *connector,
 		     struct drm_display_mode *mode)
 {
 	struct intel_display *display = to_intel_display(connector->dev);
-	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct drm_i915_private *dev_priv = to_i915(connector->dev);
 	int max_dotclk = display->cdclk.max_dotclk_freq;
 	enum drm_mode_status status;
 	int max_clock;
@@ -490,9 +489,8 @@  static int hsw_crt_compute_config(struct intel_encoder *encoder,
 static bool ilk_crt_detect_hotplug(struct drm_connector *connector)
 {
 	struct intel_display *display = to_intel_display(connector->dev);
-	struct drm_device *dev = connector->dev;
 	struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector));
-	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct drm_i915_private *dev_priv = to_i915(connector->dev);
 	u32 adpa;
 	bool ret;
 
@@ -541,9 +539,8 @@  static bool ilk_crt_detect_hotplug(struct drm_connector *connector)
 static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
 {
 	struct intel_display *display = to_intel_display(connector->dev);
-	struct drm_device *dev = connector->dev;
 	struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector));
-	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct drm_i915_private *dev_priv = to_i915(connector->dev);
 	bool reenable_hpd;
 	u32 adpa;
 	bool ret;
@@ -597,8 +594,7 @@  static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
 static bool intel_crt_detect_hotplug(struct drm_connector *connector)
 {
 	struct intel_display *display = to_intel_display(connector->dev);
-	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct drm_i915_private *dev_priv = to_i915(connector->dev);
 	u32 stat;
 	bool ret = false;
 	int i, tries = 0;
@@ -956,8 +952,7 @@  intel_crt_detect(struct drm_connector *connector,
 static int intel_crt_get_modes(struct drm_connector *connector)
 {
 	struct intel_display *display = to_intel_display(connector->dev);
-	struct drm_device *dev = connector->dev;
-	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct drm_i915_private *dev_priv = to_i915(connector->dev);
 	struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector));
 	struct intel_encoder *intel_encoder = &crt->base;
 	intel_wakeref_t wakeref;