From patchwork Tue Sep 13 08:53:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 605885 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98639C6FA83 for ; Tue, 13 Sep 2022 08:58:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231361AbiIMI63 (ORCPT ); Tue, 13 Sep 2022 04:58:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231474AbiIMI6Y (ORCPT ); Tue, 13 Sep 2022 04:58:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1792F5A2F6; Tue, 13 Sep 2022 01:58:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A3D4FB80E41; Tue, 13 Sep 2022 08:58:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2030C43151; Tue, 13 Sep 2022 08:58:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663059499; bh=/bvulmw+Dcu3Sw99w3RPEU4r6iOEX1y4z9iaAa+Si5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ke9fWfJpOvXphZ5WacYXpibfXa7I4zY0DLvGTB+8mA32uTGfIBQ8dNlNMGk6SfJou eZx1LcZabGNvCicijX9mOuc9BnMaEX0+V7OLiNVi/gceX1k0s4rCsjy46lhp7SXgMQ 3nFXMH+oyqEkngjFk1s0nplhgyg30yugByo3fn/sU348gJzt44vrbZpDE96rmK1JzL BenRx6krYhIX/F20zcW7CTTXYs3KWn9K3t+dYEMIsYjKvRZbczWuKZr0L7s4ZJZPWf Xtlj1bZ05zm2x52IMwmB34C6R14KS5DoLf++aIecSGMNsxpPPPGoMNF3gWpEi6CnJs mLUYP6k5mvorg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oY1kJ-0002HJ-2n; Tue, 13 Sep 2022 10:58:19 +0200 From: Johan Hovold To: Douglas Anderson , Dmitry Baryshkov , Rob Clark , Abhinav Kumar Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Daniel Vetter , Sean Paul , Stephen Boyd , Bjorn Andersson , Manivannan Sadhasivam , Kuogee Hsieh , Steev Klimaszewski , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v2 09/10] drm/msm/dp: drop modeset sanity checks Date: Tue, 13 Sep 2022 10:53:19 +0200 Message-Id: <20220913085320.8577-10-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220913085320.8577-1-johan+linaro@kernel.org> References: <20220913085320.8577-1-johan+linaro@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Drop the overly defensive modeset sanity checks of function parameters which have already been checked or used by the callers. Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dp/dp_display.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 808a516e84c5..33daec11f813 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1607,15 +1607,10 @@ static int dp_display_get_next_bridge(struct msm_dp *dp) int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, struct drm_encoder *encoder) { - struct msm_drm_private *priv; + struct msm_drm_private *priv = dev->dev_private; struct dp_display_private *dp_priv; int ret; - if (WARN_ON(!encoder) || WARN_ON(!dp_display) || 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;