]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/display/sdvo: Make WARN* drm specific where drm_priv ptr is available
authorPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Tue, 28 Jan 2020 18:15:59 +0000 (23:45 +0530)
committerJani Nikula <jani.nikula@intel.com>
Tue, 4 Feb 2020 08:53:17 +0000 (10:53 +0200)
drm specific WARN* calls include device information in the
backtrace, so we know what device the warnings originate from.

Covert all the calls of WARN* with device specific drm_WARN*
variants in functions where drm_i915_private struct pointer is readily
available.

The conversion was done automatically with below coccinelle semantic
patch.

@rule1@
identifier func, T;
@@
func(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-WARN(
+drm_WARN(&T->drm,
...)
|
-WARN_ON(
+drm_WARN_ON(&T->drm,
...)
|
-WARN_ONCE(
+drm_WARN_ONCE(&T->drm,
...)
|
-WARN_ON_ONCE(
+drm_WARN_ON_ONCE(&T->drm,
...)
)
...+>
}

@rule2@
identifier func, T;
@@
func(struct drm_i915_private *T,...) {
<+...
(
-WARN(
+drm_WARN(&T->drm,
...)
|
-WARN_ON(
+drm_WARN_ON(&T->drm,
...)
|
-WARN_ONCE(
+drm_WARN_ONCE(&T->drm,
...)
|
-WARN_ON_ONCE(
+drm_WARN_ON_ONCE(&T->drm,
...)
)
...+>
}

Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200128181603.27767-18-pankaj.laxminarayan.bharadiya@intel.com
drivers/gpu/drm/i915/display/intel_sdvo.c

index 225b6402718e25ce6eaccbabfe211ec321cbdbec..c098c3f92eba6ca0523642bca23d39287d667f51 100644 (file)
@@ -1506,7 +1506,8 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
 
        switch (crtc_state->pixel_multiplier) {
        default:
-               WARN(1, "unknown pixel multiplier specified\n");
+               drm_WARN(&dev_priv->drm, 1,
+                        "unknown pixel multiplier specified\n");
                /* fall through */
        case 1: rate = SDVO_CLOCK_RATE_MULT_1X; break;
        case 2: rate = SDVO_CLOCK_RATE_MULT_2X; break;
@@ -1674,9 +1675,10 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,
                }
        }
 
-       WARN(encoder_pixel_multiplier != pipe_config->pixel_multiplier,
-            "SDVO pixel multiplier mismatch, port: %i, encoder: %i\n",
-            pipe_config->pixel_multiplier, encoder_pixel_multiplier);
+       drm_WARN(dev,
+                encoder_pixel_multiplier != pipe_config->pixel_multiplier,
+                "SDVO pixel multiplier mismatch, port: %i, encoder: %i\n",
+                pipe_config->pixel_multiplier, encoder_pixel_multiplier);
 
        if (sdvox & HDMI_COLOR_RANGE_16_235)
                pipe_config->limited_color_range = true;
@@ -3236,9 +3238,9 @@ static void assert_sdvo_port_valid(const struct drm_i915_private *dev_priv,
                                   enum port port)
 {
        if (HAS_PCH_SPLIT(dev_priv))
-               WARN_ON(port != PORT_B);
+               drm_WARN_ON(&dev_priv->drm, port != PORT_B);
        else
-               WARN_ON(port != PORT_B && port != PORT_C);
+               drm_WARN_ON(&dev_priv->drm, port != PORT_B && port != PORT_C);
 }
 
 bool intel_sdvo_init(struct drm_i915_private *dev_priv,