drm/msm/dsi: drop modeset sanity checks
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 13 Sep 2022 08:53:20 +0000 (10:53 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fri, 4 Nov 2022 14:39:38 +0000 (17:39 +0300)
Drop the overly defensive modeset sanity checks of function parameters
which have already been checked or used by the callers.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/502678/
Link: https://lore.kernel.org/r/20220913085320.8577-11-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/dsi/dsi.c

index 8a95c744972a1aa28c6f091ca7c07df2b85d1e0d..31fdee2052be36ec4559dfb40c33ab70f1ce40a7 100644 (file)
@@ -211,14 +211,9 @@ void __exit msm_dsi_unregister(void)
 int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
                         struct drm_encoder *encoder)
 {
-       struct msm_drm_private *priv;
+       struct msm_drm_private *priv = dev->dev_private;
        int ret;
 
-       if (WARN_ON(!encoder) || WARN_ON(!msm_dsi) || WARN_ON(!dev))
-               return -EINVAL;
-
-       priv = dev->dev_private;
-
        if (priv->num_bridges == ARRAY_SIZE(priv->bridges)) {
                DRM_DEV_ERROR(dev->dev, "too many bridges\n");
                return -ENOSPC;