From patchwork Wed Nov 23 15:25:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13053855 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25DE8C433FE for ; Wed, 23 Nov 2022 15:29:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B055810E58D; Wed, 23 Nov 2022 15:29:53 +0000 (UTC) Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3851510E590 for ; Wed, 23 Nov 2022 15:29:49 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.west.internal (Postfix) with ESMTP id 15D402B069BF; Wed, 23 Nov 2022 10:29:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 23 Nov 2022 10:29:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1669217385; x= 1669224585; bh=Dzvf2e2t3b+Fta3pbhuPZojmvdbKi1+FhykEBF7Qb3A=; b=F IlLToB9gpNbeUlQWVCfkWraMHef9p8ycXhSY8nc3iJq+Uhsdt6TSZyhFXXIRBkwe x5mCftjCWC7sx8SROHlr8T6Isw0iZ2DkCkZkHQ7A7062Wo1aoZibb98w1Mp/ZW6U sEHNXyANec4ZSC+cJsPEX35zQv5mVIlpN3X6q7Z8FXUsBGkCI/BCh6H/syCToR5w aLE59XYtLf5PQDcyqqZ4yC8BPK4lDqHmrUw+9WZOW+Bg/mv+SR65M1SApTx9lVTh hd9hMXU/xLb9OnjUmbBRpxhi/RNjjwW9ccptJ7Xg/LpZyNcYbPHGaPjLsQw9Dwmu g0vBfK5eoX95e/16hW79g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1669217385; x= 1669224585; bh=Dzvf2e2t3b+Fta3pbhuPZojmvdbKi1+FhykEBF7Qb3A=; b=R 9TSqkfrMqzj6GWV+e5lor0hTjZPWJd4R8jRb7S19vTZG6vzrDcBeQ52e7Y8jZppH 6fvIMIhycNtpqKhlP80eDMt0xrKK5z5SNAQnA8fraZEG2Gcjgb5B8PNI5Uwqi6cY HRUoB+QQnbpUxTTmJpZUmdko8GPLLJDXmkwAte7CnHieGWO709mK9PFEcn5GJmrl m/Wm0XxXC8NYXj7C6/aVBYJ5MF2hCT0UhWgfCjHyO+Tkc83cAw75R65NM4cbZgx+ jMOtV6BMwSooEmWrRXyReKNapqkO1fUsWh8roH+wV3vWjblMDr+iLsjvg7TBG4bL TZM/47Y/9T2Sw8gE0T4zg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedriedugdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeduudduhfevjeetfeegvdffvdevvdejudegudekjeehtdelhfffveethfej ledtveenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 23 Nov 2022 10:29:44 -0500 (EST) From: Maxime Ripard Date: Wed, 23 Nov 2022 16:25:56 +0100 Subject: [PATCH 14/24] drm/vc4: txp: Reorder the variable assignments MIME-Version: 1.0 Message-Id: <20221123-rpi-kunit-tests-v1-14-051a0bb60a16@cerno.tech> References: <20221123-rpi-kunit-tests-v1-0-051a0bb60a16@cerno.tech> In-Reply-To: <20221123-rpi-kunit-tests-v1-0-051a0bb60a16@cerno.tech> To: Maxime Ripard , Maarten Lankhorst , Daniel Vetter , David Airlie , Thomas Zimmermann X-Mailer: b4 0.11.0-dev-d416f X-Developer-Signature: v=1; a=openpgp-sha256; l=1848; i=maxime@cerno.tech; h=from:subject:message-id; bh=eQTGHiaDzFDVJK7tMOdy666qnj3QVGckWUHDPGP3pU8=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMl11tXSzYfdT8d3iN+b+pJxm6nV/91GX3UTs/wMO39aLo+v SwvqKGVhEONikBVTZIkRNl8Sd2rW6042vnkwc1iZQIYwcHEKwERkrjAyrBVRaDz/Oi8mrGObpu1brb Uen1pveC6+svmQ8JWge87HuxkZHjwq83qygf2qysyODDOtwjNRh2QM4led05Wp0tY7/yuJEQA= X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?unknown-8bit?q?David_Gow_=3Cdavidgow=40google=2Ecom=3E=2C_Brendan_Higg?= =?unknown-8bit?q?ins_=3Cbrendan=2Ehiggins=40linux=2Edev=3E=2C_Greg_Kroah-Ha?= =?unknown-8bit?q?rtman_=3Cgregkh=40linuxfoundation=2Eorg=3E=2C_Dave_Stevens?= =?unknown-8bit?q?on_=3Cdave=2Estevenson=40raspberrypi=2Ecom=3E=2C_Javier_Ma?= =?unknown-8bit?q?rtinez_Canillas_=3Cjavierm=40redhat=2Ecom=3E=2C_dri-devel?= =?unknown-8bit?q?=40lists=2Efreedesktop=2Eorg=2C_linux-kernel=40vger=2Ekern?= =?unknown-8bit?q?el=2Eorg=2C_linaro-mm-sig=40lists=2Elinaro=2Eorg=2C_Ma=C3?= =?unknown-8bit?q?=ADra_Canal_=3Cmairacanal=40riseup=2Enet=3E=2C_Maxime_Ripa?= =?unknown-8bit?q?rd_=3Cmaxime=40cerno=2Etech=3E=2C_linux-kselftest=40vger?= =?unknown-8bit?q?=2Ekernel=2Eorg=2C_kunit-dev=40googlegroups=2Ecom=2C_linux?= =?unknown-8bit?q?-media=40vger=2Ekernel=2Eorg?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The current order of variable assignments is unneccessarily complex, let's make it simpler. Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/vc4/vc4_txp.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c index bd181b5a7b52..b00c6fae972f 100644 --- a/drivers/gpu/drm/vc4/vc4_txp.c +++ b/drivers/gpu/drm/vc4/vc4_txp.c @@ -490,7 +490,6 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) struct drm_device *drm = dev_get_drvdata(master); struct vc4_crtc *vc4_crtc; struct vc4_txp *txp; - struct drm_crtc *crtc; struct drm_encoder *encoder; int ret, irq; @@ -501,18 +500,16 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) txp = drmm_kzalloc(drm, sizeof(*txp), GFP_KERNEL); if (!txp) return -ENOMEM; - vc4_crtc = &txp->base; - crtc = &vc4_crtc->base; - - vc4_crtc->pdev = pdev; - vc4_crtc->data = &vc4_txp_crtc_data; - vc4_crtc->feeds_txp = true; txp->pdev = pdev; - txp->regs = vc4_ioremap_regs(pdev, 0); if (IS_ERR(txp->regs)) return PTR_ERR(txp->regs); + + vc4_crtc = &txp->base; + vc4_crtc->pdev = pdev; + vc4_crtc->data = &vc4_txp_crtc_data; + vc4_crtc->feeds_txp = true; vc4_crtc->regset.base = txp->regs; vc4_crtc->regset.regs = txp_regs; vc4_crtc->regset.nregs = ARRAY_SIZE(txp_regs); @@ -533,7 +530,7 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) return ret; encoder = &txp->connector.encoder; - encoder->possible_crtcs = drm_crtc_mask(crtc); + encoder->possible_crtcs = drm_crtc_mask(&vc4_crtc->base); ret = devm_request_irq(dev, irq, vc4_txp_interrupt, 0, dev_name(dev), txp);