From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2213CC433E0 for ; Mon, 25 Jan 2021 11:53:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9CC00229C7 for ; Mon, 25 Jan 2021 11:53:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CC00229C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GtIj6UFervJrvoNqOP0tACL4I3hoyMdbJrqaFKh2LIQ=; b=fbiYzzEoSyyT7zsSivFEuihRV Lbi3X7eCRi+ujF4rSZAiHC+bFfbJqYUbkj4u/we7+0Wj7Pwt6pRCKXU5QPY5Om4uqEum8SEX2vbWT MGplCjcTvDURHYX8xxXtLiMERBg0F9o2YxJDPAWWqEW+oOUXbLi+rCnOb6d22yoLTRIYHEgcs6pFj t+YJBgnEkVNvffbdtn7VBAOAUW1lACeO6YyB17ENH0ImKohNq+8mrMLz9QmW4XwdPiTW8dS6+++PO +FUQ4jXxZkMJemJ6qoG6PgE9647/3s9GpqcggPqrtyCfgt7IFhEGx/EOpzY+KXoS7sFiBajG4QlFS axnQyh//A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l40QW-0003DR-9D; Mon, 25 Jan 2021 11:53:00 +0000 Received: from mga14.intel.com ([192.55.52.115]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l40QU-0003B8-3P; Mon, 25 Jan 2021 11:52:59 +0000 IronPort-SDR: JqhrDdetE1Mi9y+6iKDqLd2l60Gy2+AkhmfU/4lusldD+PF9nUU49WBH1bHB+OmBKkl/cbTqx7 WjNzu0r5B3aQ== X-IronPort-AV: E=McAfee;i="6000,8403,9874"; a="178934727" X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="178934727" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.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 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-Disposition: inline In-Reply-To: <20210125105218.kv63vjbxz5b35hdo@gilmour> X-Patchwork-Hint: comment X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210125_065258_300747_BC6A5365 X-CRM114-Status: GOOD ( 25.16 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Liviu Dudau , dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org, Paul Cercueil , Matthias Brugger , Thierry Reding , Daniel Vetter , linux-stm32@st-md-mailman.stormreply.com, Jerome Brunet , Marek Vasut , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , linux-rockchip@lists.infradead.org, Kevin Hilman , Russell King , Krzysztof Kozlowski , Jonathan Hunter , Xinliang Liu , Xinwei Kong , Sandy Huang , NXP Linux Team , Chen Feng , Dave Airlie , Chun-Kuang Hu , Alexandre Torgue , Martin Blumenstingl , linux-arm-msm@vger.kernel.org, Sascha Hauer , Alison Wang , Maarten Lankhorst , linux-mediatek@lists.infradead.org, Vincent Abriou , Laurentiu Palcu , linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org, Sean Paul , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, Maxime Coquelin , Tomi Valkeinen , Jyri Sarha , Seung-Woo Kim , Philippe Cornu , linux-kernel@vger.kernel.org, Yannick Fertre , Kyungmin Park , Thomas Zimmermann , Tian Tao , freedreno@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.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=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 pas= sed > > > 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 =3D { > > > ..., > > > .atomic_disable =3D func, > > > ..., > > > }; > > > | > > > static const struct drm_plane_helper_funcs helpers =3D { > > > ..., > > > .atomic_update =3D 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 =3D plane->state; > > > + struct drm_plane_state *new_state =3D 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=E4l=E4 -- = Ville Syrj=E4l=E4 Intel _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA2F8C433E0 for ; Tue, 26 Jan 2021 05:22:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89323229C4 for ; Tue, 26 Jan 2021 05:22:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732314AbhAZFWU (ORCPT ); Tue, 26 Jan 2021 00:22:20 -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-arm-msm@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE4C4C433DB for ; Mon, 25 Jan 2021 11:53:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4DE66229C7 for ; Mon, 25 Jan 2021 11:53:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DE66229C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZhnwKnphpxuA+ASz3dxgcoyhX7yb1g++eHD5kdogtK0=; b=gp1kGPwV+6KWch4wwx9ch8rCI hB5KpuynjdyGE9M5WkNWDNRTAjYABalA1DCmhpSLcP3Fqo7yx5CDWQ+ODkkVkDx331TVQKxxBM+Dh RksVmStQBUHCsjAX0wKjjnx1tequJFaocgbnsexmrpdO4opHhYRZ0YNcMgDzpMSfeeZwYK8XkA4w/ TvNBqyQWFbTVMUgtQutIZdVHSTeIqhE3etYb/vL7yJyKvKCbKfzqpiSy3jP2eTebNsGlFJN6uBq9F YfZkGzDKlcnfoJrWFhkdLdPKizlr2kYXSkDlPlmS9w0TCiuUAQXj4NmxnmvG8r0jShaFczxJBq+Zh uyNr7jOIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l40Qa-0003E2-EB; Mon, 25 Jan 2021 11:53:04 +0000 Received: from mga14.intel.com ([192.55.52.115]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l40QU-0003B8-3P; Mon, 25 Jan 2021 11:52:59 +0000 IronPort-SDR: JqhrDdetE1Mi9y+6iKDqLd2l60Gy2+AkhmfU/4lusldD+PF9nUU49WBH1bHB+OmBKkl/cbTqx7 WjNzu0r5B3aQ== X-IronPort-AV: E=McAfee;i="6000,8403,9874"; a="178934727" X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="178934727" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.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 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-Disposition: inline In-Reply-To: <20210125105218.kv63vjbxz5b35hdo@gilmour> X-Patchwork-Hint: comment X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210125_065258_300747_BC6A5365 X-CRM114-Status: GOOD ( 25.16 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Liviu Dudau , dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org, Paul Cercueil , Matthias Brugger , Thierry Reding , Daniel Vetter , linux-stm32@st-md-mailman.stormreply.com, Jerome Brunet , Marek Vasut , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , linux-rockchip@lists.infradead.org, Kevin Hilman , Russell King , Krzysztof Kozlowski , Jonathan Hunter , Xinliang Liu , Xinwei Kong , Sandy Huang , NXP Linux Team , Chen Feng , Dave Airlie , Chun-Kuang Hu , Alexandre Torgue , Martin Blumenstingl , linux-arm-msm@vger.kernel.org, Sascha Hauer , Alison Wang , Maarten Lankhorst , linux-mediatek@lists.infradead.org, Vincent Abriou , Laurentiu Palcu , linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org, Sean Paul , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, Maxime Coquelin , Tomi Valkeinen , Jyri Sarha , Seung-Woo Kim , Philippe Cornu , linux-kernel@vger.kernel.org, Yannick Fertre , Kyungmin Park , Thomas Zimmermann , Tian Tao , freedreno@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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=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 pas= sed > > > 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 =3D { > > > ..., > > > .atomic_disable =3D func, > > > ..., > > > }; > > > | > > > static const struct drm_plane_helper_funcs helpers =3D { > > > ..., > > > .atomic_update =3D 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 =3D plane->state; > > > + struct drm_plane_state *new_state =3D 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=E4l=E4 -- = Ville Syrj=E4l=E4 Intel _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0C74C433DB for ; Mon, 25 Jan 2021 11:53:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A06C22D04 for ; Mon, 25 Jan 2021 11:53:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A06C22D04 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=x6GBXvoYge+KZJWc0/K93/J73W3TiYazrp4pZDoNdFs=; b=qpW7OCcCFBr1x3Y+fIzYLUyTp usi7rdaKg9zMEm7uouWgEn2OeLW+PmShqH+bbnp9nmbixfn4kd1yJ6yaF5lhYeWzG+DsnEPJjES7R CjRoRxokkqRSz2BOdrcGbKjDpKBPUSCN+tebiWo0D+768JwOf+jIJBJXXi0SOpqevRMa+Xs6sBlQg 9AZQxf8PnI/Ghi/BihlDION9gIPhDbJOsJvu5r2FSerFyTjW1i+VG7PpEEyJhtMFR0Zgf8fWuJIul 6vuYo3/ZOcG1FARbruipAVPFUcsIMwRxdiBvLoJjzyXxRbU4Kv2oOlPLFtwd3XrsnDd8VzJBrAEId KUN3Bdoyw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l40Qa-0003Ds-0J; Mon, 25 Jan 2021 11:53:04 +0000 Received: from mga14.intel.com ([192.55.52.115]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l40QU-0003B8-3P; Mon, 25 Jan 2021 11:52:59 +0000 IronPort-SDR: JqhrDdetE1Mi9y+6iKDqLd2l60Gy2+AkhmfU/4lusldD+PF9nUU49WBH1bHB+OmBKkl/cbTqx7 WjNzu0r5B3aQ== X-IronPort-AV: E=McAfee;i="6000,8403,9874"; a="178934727" X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="178934727" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.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 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-Disposition: inline In-Reply-To: <20210125105218.kv63vjbxz5b35hdo@gilmour> X-Patchwork-Hint: comment X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210125_065258_300747_BC6A5365 X-CRM114-Status: GOOD ( 25.16 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Liviu Dudau , dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org, Paul Cercueil , Matthias Brugger , Thierry Reding , Daniel Vetter , linux-stm32@st-md-mailman.stormreply.com, Jerome Brunet , Marek Vasut , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , linux-rockchip@lists.infradead.org, Kevin Hilman , Russell King , Krzysztof Kozlowski , Jonathan Hunter , Xinliang Liu , Xinwei Kong , Sandy Huang , NXP Linux Team , Chen Feng , Dave Airlie , Chun-Kuang Hu , Alexandre Torgue , Martin Blumenstingl , linux-arm-msm@vger.kernel.org, Sascha Hauer , Alison Wang , Maarten Lankhorst , linux-mediatek@lists.infradead.org, Vincent Abriou , Laurentiu Palcu , linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org, Sean Paul , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, Maxime Coquelin , Tomi Valkeinen , Jyri Sarha , Seung-Woo Kim , Philippe Cornu , linux-kernel@vger.kernel.org, Yannick Fertre , Kyungmin Park , Thomas Zimmermann , Tian Tao , freedreno@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.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=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 pas= sed > > > 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 =3D { > > > ..., > > > .atomic_disable =3D func, > > > ..., > > > }; > > > | > > > static const struct drm_plane_helper_funcs helpers =3D { > > > ..., > > > .atomic_update =3D 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 =3D plane->state; > > > + struct drm_plane_state *new_state =3D 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=E4l=E4 -- = Ville Syrj=E4l=E4 Intel _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DA0EC433E0 for ; Mon, 25 Jan 2021 11:52:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0442422D50 for ; Mon, 25 Jan 2021 11:52:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0442422D50 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2421889C9B; Mon, 25 Jan 2021 11:52:52 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F3B289C9B; Mon, 25 Jan 2021 11:52:51 +0000 (UTC) IronPort-SDR: 7UKOBn+32+mZxlffqn0PkSGEHWl+ahxlxBHCF4dYem4R7ZfQRr89ENA0pAeEHXL6q8yveVZCqO hReFdjPk1OZg== X-IronPort-AV: E=McAfee;i="6000,8403,9874"; a="198488809" X-IronPort-AV: E=Sophos;i="5.79,373,1602572400"; d="scan'208";a="198488809" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.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 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-Disposition: inline In-Reply-To: <20210125105218.kv63vjbxz5b35hdo@gilmour> X-Patchwork-Hint: comment 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: Neil Armstrong , David Airlie , Liviu Dudau , dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org, Paul Cercueil , Matthias Brugger , Thierry Reding , Daniel Vetter , linux-stm32@st-md-mailman.stormreply.com, Jerome Brunet , Marek Vasut , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , linux-rockchip@lists.infradead.org, Kevin Hilman , Russell King , Krzysztof Kozlowski , Jonathan Hunter , Xinliang Liu , Xinwei Kong , Sandy Huang , NXP Linux Team , Chen Feng , Dave Airlie , Chun-Kuang Hu , Alexandre Torgue , Martin Blumenstingl , linux-arm-msm@vger.kernel.org, Sascha Hauer , Alison Wang , linux-mediatek@lists.infradead.org, Vincent Abriou , Laurentiu Palcu , linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org, Sean Paul , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, Maxime Coquelin , Tomi Valkeinen , Jyri Sarha , Seung-Woo Kim , Philippe Cornu , linux-kernel@vger.kernel.org, Yannick Fertre , Kyungmin Park , Thomas Zimmermann , Tian Tao , freedreno@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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=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 pas= sed > > > 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 =3D { > > > ..., > > > .atomic_disable =3D func, > > > ..., > > > }; > > > | > > > static const struct drm_plane_helper_funcs helpers =3D { > > > ..., > > > .atomic_update =3D 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 =3D plane->state; > > > + struct drm_plane_state *new_state =3D 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=E4l=E4 -- = Ville Syrj=E4l=E4 Intel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel