Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4146084pxb; Tue, 26 Jan 2021 13:41:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXbKzcGIJrMtmIIksgNpOaiooF+jANWG+iyUabDKWoLe/yOGtgT8t9r/4q3+JdkNgzQ4Bt X-Received: by 2002:aa7:c485:: with SMTP id m5mr6014650edq.320.1611697304350; Tue, 26 Jan 2021 13:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611697304; cv=none; d=google.com; s=arc-20160816; b=m0ITGWpFttzIlkXp6Gx8Wk2t/0w5NJHKk2ynRhdF+mdCAneJ3DH/HFL5r6yuddGJh9 7TuUQPsNHECZmi4GEBgaVgvq8j+E0QB6gDl5zR9G7QFNtLG+wVJzmghysYJWb/8vwIfP WM/e5JfC32zxV1JKqrrAOZcbHLZoRkd1uAlQxZaydbeaskhyWxQWC3qMk8W3Xho5TiKU NVZF8oZhw7FhyiDSFTA3SW6g1r4CCgzzfaQ59vOHMT45b8CNx+nCETaa2jrkWesUeggE 3qJu+u2QyFRoi8e+qQPaICdLhzSMpxV9PtodvtPTJ/skWpjhhDSHBfOiKyYQwARViGQC eYbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=7Q7Nv0bqu4rlGBtYQ+gbUns0wJuh6GuAiFJdP+cGZnE=; b=Dxl7bL8+y7CwYn2o2kUP19FqzLossKCR3UQVTTVdVg0dYXjH4WWfAuuDU0A9702iRC MV1vV6JbrxLMyYAoG3dgVVOdJ7cnAJ4Lw6fR9Dvj2UKFXr0vDsu0E7/yyadTgT01/GrY 5WeAr5UqEA6UOaak2bTRxgruFRG5VzIfKXD8eyQlenFnwg/j2yMeDFxMF9RWUbGnpySr CjCWU9u+ZfgrpKXcui0Pg/wH/fY2tvxLnh3ku4kXQg/iGc0hMy9+NkSRKPdo/X6GNtlG APe9FKh8qoY/gjVdUHPViZfD0q65HWJENiTyU82hmnTfTLHoztN/K3cKD6RHE7R9Yp57 Znzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b="SvMo/+4j"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=YeHVXlHv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id os5si7531366ejb.629.2021.01.26.13.41.19; Tue, 26 Jan 2021 13:41:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b="SvMo/+4j"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=YeHVXlHv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388255AbhAZFjl (ORCPT + 99 others); Tue, 26 Jan 2021 00:39:41 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:34645 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727561AbhAYLCB (ORCPT ); Mon, 25 Jan 2021 06:02:01 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 8C6885805B3; Mon, 25 Jan 2021 05:52:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 25 Jan 2021 05:52:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=7Q7Nv0bqu4rlGBtYQ+gbUns0wJu h6GuAiFJdP+cGZnE=; b=SvMo/+4j2yNGhwp07OIeEeAwIPd3uLOkCRwQa21lHhP uBTNRs15VHVc0Wnm9juBrZh1WRoUfbAjl6OGg+3BMqWfLxbqr0GfnnNKvhRLv6z8 Ht3Sogfq/tair/mlm5M0Ws4IhMxyYJJ5aB3ZMTsXfj7rPgB4UyKFB1tZPz0DRliK BHwi/farpZU9725kMRANiZjHMFssH8S/rOxF64POXubAjGC5dTdmZE9SM5r6LpI6 3qeQ+jTkTpu2F1mx8CbaWl09kJjYGCSK7wcAudZIvP/ea20jayJYzTRZs3bFHtVl zCtbT3ZRCuxdI95cj5o9sQvZsw9/YnQhvwNRcBsm0nQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=7Q7Nv0 bqu4rlGBtYQ+gbUns0wJuh6GuAiFJdP+cGZnE=; b=YeHVXlHvXL396hBceHKuI1 2nodfeUi1jgIMhqjbIrcZLxiFtsltIkSU/rRD+IJBCKaviaCLZGCkHZUipzKh8aI YIp/m5NnLSU2gciUh/8Z1vTesObQnehVBhj4ngYN/Pf+cMEOkKiXjciatPw7K5uH KudFDbebfOFPHJfhLJKCfaWkyxBtzj2zcRrPeBXnnOG5RFH0coWQFtNlbSwC8t7p TYDH6qiIQ9QsegeQ3ZYr4Evcty2XIdgHyKS9BpK2qBedU/+5qgGyO94tCOGu/vcn UzMGe0Zs8hFTbEAt0SgII0xE2YdNu782KoFPPFHrfDCKzEbkhEw4It5xt1I0TUJQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdefgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtudenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeduvdduhfekkeehgffftefflefgffdtheffudffgeevteffheeuiedvvdejvdfg veenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id E512724005A; Mon, 25 Jan 2021 05:52:19 -0500 (EST) Date: Mon, 25 Jan 2021 11:52:18 +0100 From: Maxime Ripard To: Ville =?utf-8?B?U3lyasOkbMOk?= Cc: Maarten Lankhorst , Thomas Zimmermann , Daniel Vetter , David Airlie , Neil Armstrong , Xinliang Liu , Liviu Dudau , Philippe Cornu , Paul Cercueil , linux-tegra@vger.kernel.org, Thierry Reding , linux-stm32@st-md-mailman.stormreply.com, Jerome Brunet , Marek Vasut , Yannick Fertre , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , Kevin Hilman , linux-mediatek@lists.infradead.org, Russell King , Krzysztof Kozlowski , Jonathan Hunter , linux-rockchip@lists.infradead.org, Xinwei Kong , NXP Linux Team , linux-arm-msm@vger.kernel.org, Dave Airlie , linux-mips@vger.kernel.org, Chun-Kuang Hu , Alexandre Torgue , Martin Blumenstingl , Chen Feng , Sascha Hauer , Alison Wang , dri-devel@lists.freedesktop.org, Laurentiu Palcu , Matthias Brugger , linux-amlogic@lists.infradead.org, freedreno@lists.freedesktop.org, Sean Paul , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, Maxime Coquelin , Tomi Valkeinen , Jyri Sarha , Seung-Woo Kim , Sandy Huang , linux-kernel@vger.kernel.org, Vincent Abriou , Kyungmin Park , Tian Tao Subject: Re: [PATCH v2 08/11] drm: Rename plane->state variables in atomic update and disable Message-ID: <20210125105218.kv63vjbxz5b35hdo@gilmour> References: <20210121163537.1466118-1-maxime@cerno.tech> <20210121163537.1466118-8-maxime@cerno.tech> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aovqw5rvxy3ynmws" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --aovqw5rvxy3ynmws Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Ville, On Fri, Jan 22, 2021 at 02:15:07PM +0200, Ville Syrj=E4l=E4 wrote: > On Thu, Jan 21, 2021 at 05:35:33PM +0100, Maxime Ripard wrote: > > Some drivers are storing the plane->state pointer in atomic_update and > > atomic_disable in a variable simply called state, while the state passed > > as an argument is called old_state. > >=20 > > In order to ease subsequent reworks and to avoid confusing or > > inconsistent names, let's rename those variables to new_state. > >=20 > > This was done using the following coccinelle script, plus some manual > > changes for mtk and tegra. > >=20 > > @ plane_atomic_func @ > > identifier helpers; > > identifier func; > > @@ > >=20 > > ( > > static const struct drm_plane_helper_funcs helpers =3D { > > ..., > > .atomic_disable =3D func, > > ..., > > }; > > | > > static const struct drm_plane_helper_funcs helpers =3D { > > ..., > > .atomic_update =3D func, > > ..., > > }; > > ) > >=20 > > @ moves_new_state_old_state @ > > identifier plane_atomic_func.func; > > identifier plane; > > symbol old_state; > > symbol state; > > @@ > >=20 > > func(struct drm_plane *plane, struct drm_plane_state *old_state) > > { > > ... > > - struct drm_plane_state *state =3D plane->state; > > + struct drm_plane_state *new_state =3D plane->state; > > ... > > } > >=20 > > @ depends on moves_new_state_old_state @ > > identifier plane_atomic_func.func; > > identifier plane; > > identifier old_state; > > symbol state; > > @@ > >=20 > > func(struct drm_plane *plane, struct drm_plane_state *old_state) > > { > > <... > > - state > > + new_state > > ...> >=20 > Was going to say that this migh eat something else, but I guess > the dependency prevents that? Yeah, the dependency takes care of this > Another way to avoid that I suppose would be to declare 'state' > as > symbol moves_new_state_old_state.state; >=20 > That would probably make the intent a bit more obvious, even with > the dependency. Or does a dependency somehow automagically imply > that? I'm not sure if it does, but it's a symbol here not an identifier or an expression, so here moves_new_state_old_state.state would always resolve to state (and only state) anyway Maxime --aovqw5rvxy3ynmws Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYA6i4gAKCRDj7w1vZxhR xXQfAQCpHFLAgzbOGuPHlUIw6srwonDWlJwZ5pDLwhp1/pTOIgEAwAm6K8CkMgzh mwxW8RrOr5SMiQknGuS5OfDWZlYZBwo= =AjKT -----END PGP SIGNATURE----- --aovqw5rvxy3ynmws--