Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5459978rwn; Mon, 12 Sep 2022 09:19:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR4nPtSYY4A/csYZ0ZENUTLOVIjenBkqZYkXL8JS7gcC4gvGBVCIV+W3ixq05Qg0TQarYLot X-Received: by 2002:aa7:df8b:0:b0:44e:882f:7c5c with SMTP id b11-20020aa7df8b000000b0044e882f7c5cmr22582918edy.418.1662999566122; Mon, 12 Sep 2022 09:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662999566; cv=none; d=google.com; s=arc-20160816; b=dDyuEMRga88Ir1/mK3aHJALz4Fcrys+8vLnZLmYqtGzT1lwaxdnAKIrwLsc6tnA650 KaDfso6RNDLTNFjbkqE7Js5esFj497LXKGwsUyRWeH+Dv5KkLvLqp6GvbHWztXvGinU1 wfXTub9xNFgYOA2aR3/FAxw1JH8/fzx60CuDHFCkZrgt5S7yiwsWSgEv2TResTQkoNah BICE0JrGPBk6UXYmYb+Jm8pb++djMXiG1rQE9HWUgZ0V24GbnUcljEiW1a25b+9rdKqH Tq+B1B/pfNao65oBbTbnR2lGycXaWIdOeAf/FW53BpvJ6hz3ek1OQM2rapUwAiWtDzVv CvEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BpJ4izTJd7Mu2245xaUJgehAC66xeAauYoXRkUByP54=; b=TIUMkA30PzBtR+xoaeK4rIkZZz8FR4mYCaOjeg8buGgO1JeduubjSqMrNppYeYKAnE WRZTv0pU84DF7rNnGVB1UwptLqh7d8eAluCjKYfbMQ0etJZ2eGtKxFGO8tOYB//pniZP N9V6Ms+gpfASPTu3jvvgIu+Nz5gyUqU+JAJQGnsf4exrWq5+DBM6AwZ0jqe3hsOsmBjE I91qCJSt+vKI3+ZjmVo57aNOWgYCDdtwC1JpyFvosL/9oO6K1JXCKqz2iLpp8mNBE3Vs OoyrWOdZaP4HryK8Vu4GCKLOfvfvzamZo9hD1kLgFIn+P3pBt6Jr0bTfQw1c27zpu86F rWcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cuhz9DEL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd40-20020a17090796a800b007306ac0faa0si5586204ejc.615.2022.09.12.09.18.58; Mon, 12 Sep 2022 09:19:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cuhz9DEL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230407AbiILPli (ORCPT + 99 others); Mon, 12 Sep 2022 11:41:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbiILPl2 (ORCPT ); Mon, 12 Sep 2022 11:41:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7C1F2BB0A; Mon, 12 Sep 2022 08:41:27 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 41DBE61259; Mon, 12 Sep 2022 15:41:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E629C43144; Mon, 12 Sep 2022 15:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662997286; bh=NvUPn637z6uLalY0boDdcXrcj/rg6GMPWSoihJhuhnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cuhz9DELmb+VMsNghrKvvabDT47SnHzyP7fPgGTEhXDCzH5DLcOFeJhEH8HL7aCPD MoqfnPuxjhHHpNtIXi4RQSa59WG3G+ffR3BQomxaGU6d4mKJPe4LJU5k8XWFypnvWD GpZppgjBhdNtvaHDLN3+PnIpI9KC6JY5h2OxAvEqtKB9phidytPw46H+/umJ7qHhyH wu+V0Hm4uSLaybeSB5njmUozFZ6ZcFaMG7vS6O6unarZzzHALWBCLQPWHWpN4Iy3rF HfZyfk6SxatSKX3N28/SQP4gQAwD9DEW0McrXXJ5WkBzZaXr16R2glvWG4nJj8iiLH uc2nEPXAGhWyA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oXlYp-0003N0-Ni; Mon, 12 Sep 2022 17:41:23 +0200 From: Johan Hovold To: Douglas Anderson , Dmitry Baryshkov , Rob Clark Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Sean Paul , Stephen Boyd , Bjorn Andersson , Manivannan Sadhasivam , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 7/7] drm/msm: drop modeset sanity checks Date: Mon, 12 Sep 2022 17:40:46 +0200 Message-Id: <20220912154046.12900-8-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912154046.12900-1-johan+linaro@kernel.org> References: <20220912154046.12900-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop the overly defensive modeset sanity checks of function parameters which have already been checked or used by the callers. Signed-off-by: Johan Hovold --- drivers/gpu/drm/msm/dp/dp_display.c | 7 +------ drivers/gpu/drm/msm/dsi/dsi.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 393af1ea9ed8..8ad28bf81abe 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1597,15 +1597,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; diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 8a95c744972a..31fdee2052be 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -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; -- 2.35.1