Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4322270pxb; Tue, 26 Jan 2021 19:35:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxn0fKOPt4iQaxaGPQFoUfWpxEy9iR4BHhnJe10tGE12HHNCfw+dCaCBSIC9rDDinxfTZkl X-Received: by 2002:a50:d646:: with SMTP id c6mr7039048edj.177.1611718526634; Tue, 26 Jan 2021 19:35:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611718526; cv=none; d=google.com; s=arc-20160816; b=Oj6cV/f/OWJPtokIZUnHeufFh2hQRXBkYK9pEx4xhlZ3YCxP/InPFOqWen6JPPRQk1 N11Pz+Ts5z0pRhgYAxTuB6diMaoqdJUmHNWGkakzwSlZKcI9I3p+HIXVH+t0w+yq9D/x oCWBtEW4nxQFyZ09unFtBZ9oCDZLjFkHUuf4LwO7OYu301aB5ohCBxGL6fyDWekn4vup Z7hEmZIxdt+igx5gk1lHgmaxI6dQTlJJgA2SykHy+zpm7djhKteN9t5KFvyZZYOr2oKt 8rBI0ZrOEp298kdR5JYAyTMyClhLmf4qOo0zeX//BKWReIHPrnV0ju1y3H02wSKEE/7Z x89Q== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=wz58ROuHQgFgUS4bJcMs26r+y1yOk6acUGe49IVmaFk=; b=c4OwLfAp5SPWMFmvVTlPQ6Lsy6oA4yRLGh0rLap1nMrkihS4X86pkQVqBaRPHQLpJW 66IFQ+ILNUXeTKekBDL8f2ZK/dX4AKWnLJwMcUHX8Hj8biMoPFg5lmTv7VUncpUYNl0o 7TNSdmFnnoM0VJoKkxTfWPar+EwJMGW7LdcHOhR4YjUQ3u7cNWkmfNdEW8eclaWl7hFe RHuuOBv7eLIz7vTsFwqiRzJyCJu+J5o7aodWaXx+wkNKw3WLvVZq0zkazSLHQw3zWPcN +LrgqoeThqfy3Y3HgeocHw8dOlErKErsHH1ZuXYG0SOynv+RHIwvTdGdPGH04p4dnur6 bXxQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si320514edb.578.2021.01.26.19.35.02; Tue, 26 Jan 2021 19:35:26 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388477AbhAZFok (ORCPT + 99 others); Tue, 26 Jan 2021 00:44:40 -0500 Received: from mga02.intel.com ([134.134.136.20]:47122 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727837AbhAYMLv (ORCPT ); Mon, 25 Jan 2021 07:11:51 -0500 IronPort-SDR: fqz5a1tn3qhlMUlkY76XwQXck4G6XKSaQOGwObuDQINO2RFZplUNFUZ0mza3zGyUSkwAAvW5Ko mN5FdGqLc2gg== X-IronPort-AV: E=McAfee;i="6000,8403,9874"; a="166812576" X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="166812576" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 03:52:51 -0800 IronPort-SDR: 48DaYsnvHv+gYU3iB0lIM7aytVWrCoDavD2mjf0kyTM07tuyUD4vfRcB0epq/cCvtOYMGfxoLJ ZQzg2k7suibA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="472167193" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 25 Jan 2021 03:52:39 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 25 Jan 2021 13:52:38 +0200 Date: Mon, 25 Jan 2021 13:52:38 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Maxime Ripard 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: References: <20210121163537.1466118-1-maxime@cerno.tech> <20210121163537.1466118-8-maxime@cerno.tech> <20210125105218.kv63vjbxz5b35hdo@gilmour> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210125105218.kv63vjbxz5b35hdo@gilmour> X-Patchwork-Hint: comment Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 25, 2021 at 11:52:18AM +0100, Maxime Ripard wrote: > Hi Ville, > > On Fri, Jan 22, 2021 at 02:15:07PM +0200, Ville Syrj?l? 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. > > > > > > In order to ease subsequent reworks and to avoid confusing or > > > inconsistent names, let's rename those variables to new_state. > > > > > > This was done using the following coccinelle script, plus some manual > > > changes for mtk and tegra. > > > > > > @ plane_atomic_func @ > > > identifier helpers; > > > identifier func; > > > @@ > > > > > > ( > > > static const struct drm_plane_helper_funcs helpers = { > > > ..., > > > .atomic_disable = func, > > > ..., > > > }; > > > | > > > static const struct drm_plane_helper_funcs helpers = { > > > ..., > > > .atomic_update = func, > > > ..., > > > }; > > > ) > > > > > > @ moves_new_state_old_state @ > > > identifier plane_atomic_func.func; > > > identifier plane; > > > symbol old_state; > > > symbol state; > > > @@ > > > > > > func(struct drm_plane *plane, struct drm_plane_state *old_state) > > > { > > > ... > > > - struct drm_plane_state *state = plane->state; > > > + struct drm_plane_state *new_state = plane->state; > > > ... > > > } > > > > > > @ depends on moves_new_state_old_state @ > > > identifier plane_atomic_func.func; > > > identifier plane; > > > identifier old_state; > > > symbol state; > > > @@ > > > > > > func(struct drm_plane *plane, struct drm_plane_state *old_state) > > > { > > > <... > > > - state > > > + new_state > > > ...> > > > > 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; > > > > 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 Hm. Right. OK, cocci bits look good to me. Variable naming bikeshed I'll leave to others :) Reviewed-by: Ville Syrj?l? -- Ville Syrj?l? Intel