drm/i915/display: Convert i9xx_pipe_crc_auto_source to void
authorDeepak R Varma <drv@mailo.com>
Sat, 14 Jan 2023 14:03:53 +0000 (19:33 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 18 Jan 2023 16:33:04 +0000 (11:33 -0500)
Convert function i9xx_pipe_crc_auto_source() to return void instead
of int since the current implementation always returns 0 to the caller.
Issue identified using returnvar Coccinelle semantic patch.

$ make coccicheck COCCI=scripts/coccinelle/misc/returnvar.cocci \
M=drivers/gpu/drm/i915/

Signed-off-by: Deepak R Varma <drv@mailo.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Y8K2SS/zNiPAmLsS@ubun2204.myguest.virtualbox.org
drivers/gpu/drm/i915/display/intel_pipe_crc.c

index e9774670e3f6442c144a84e6d3e20653b380a99e..8d3ea8d7b737202af307143672d6050409374500 100644 (file)
@@ -72,14 +72,13 @@ static int i8xx_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source,
        return 0;
 }
 
-static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv,
-                                    enum pipe pipe,
-                                    enum intel_pipe_crc_source *source)
+static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv,
+                                     enum pipe pipe,
+                                     enum intel_pipe_crc_source *source)
 {
        struct intel_encoder *encoder;
        struct intel_crtc *crtc;
        struct intel_digital_port *dig_port;
-       int ret = 0;
 
        *source = INTEL_PIPE_CRC_SOURCE_PIPE;
 
@@ -121,8 +120,6 @@ static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv,
                }
        }
        drm_modeset_unlock_all(&dev_priv->drm);
-
-       return ret;
 }
 
 static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
@@ -132,11 +129,8 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
 {
        bool need_stable_symbols = false;
 
-       if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) {
-               int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
-               if (ret)
-                       return ret;
-       }
+       if (*source == INTEL_PIPE_CRC_SOURCE_AUTO)
+               i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
 
        switch (*source) {
        case INTEL_PIPE_CRC_SOURCE_PIPE:
@@ -200,11 +194,8 @@ static int i9xx_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
                                 enum intel_pipe_crc_source *source,
                                 u32 *val)
 {
-       if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) {
-               int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
-               if (ret)
-                       return ret;
-       }
+       if (*source == INTEL_PIPE_CRC_SOURCE_AUTO)
+               i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
 
        switch (*source) {
        case INTEL_PIPE_CRC_SOURCE_PIPE: