devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Ying <victor.liu@nxp.com>
To: linux-arm-kernel@lists.infradead.org,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: p.zabel@pengutronix.de, airlied@linux.ie, daniel@ffwll.ch,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com,
	robh+dt@kernel.org, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de
Subject: [PATCH 4/8] drm/atomic: Avoid unused-but-set-variable warning on for_each_old_plane_in_state
Date: Thu, 19 Nov 2020 17:22:21 +0800	[thread overview]
Message-ID: <1605777745-23625-5-git-send-email-victor.liu@nxp.com> (raw)
In-Reply-To: <1605777745-23625-1-git-send-email-victor.liu@nxp.com>

Artifically use 'plane' and 'old_plane_state' to avoid 'not used' warning.
The precedent has already been set by other macros in the same file.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
 include/drm/drm_atomic.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 54e051a..9da1e35a3 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -888,7 +888,9 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
 	     (__i)++)							\
 		for_each_if ((__state)->planes[__i].ptr &&		\
 			     ((plane) = (__state)->planes[__i].ptr,	\
-			      (old_plane_state) = (__state)->planes[__i].old_state, 1))
+			      (void)(plane) /* Only to avoid unused-but-set-variable warning */, \
+			      (old_plane_state) = (__state)->planes[__i].old_state, \
+			      (void)(old_plane_state) /* Only to avoid unused-but-set-variable warning */, 1))
 /**
  * for_each_new_plane_in_state - iterate over all planes in an atomic update
  * @__state: &struct drm_atomic_state pointer
-- 
2.7.4


  parent reply	other threads:[~2020-11-19  9:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19  9:22 [PATCH 0/8] drm/imx: Introduce i.MX8qxp DPU DRM Liu Ying
2020-11-19  9:22 ` [PATCH 1/8] dt-bindings: display: imx: Add i.MX8qxp/qm DPU binding Liu Ying
2020-11-19 15:46   ` Rob Herring
2020-11-20  3:40     ` Liu Ying
2020-11-19  9:22 ` [PATCH 2/8] dt-bindings: display: imx: Add i.MX8qxp/qm PRG binding Liu Ying
2020-11-19 15:48   ` Rob Herring
2020-11-19  9:22 ` [PATCH 3/8] dt-bindings: display: imx: Add i.MX8qxp/qm DPR channel binding Liu Ying
2020-11-19 15:48   ` Rob Herring
2020-11-19  9:22 ` Liu Ying [this message]
2020-11-19  9:22 ` [PATCH 5/8] drm/imx: Introduce i.MX8qxp DPU DRM Liu Ying
2020-11-20 14:38   ` Laurentiu Palcu
2020-11-23  2:45     ` Liu Ying
2020-11-23 12:33       ` Laurentiu Palcu
2020-11-19  9:22 ` [PATCH 6/8] MAINTAINERS: add maintainer for i.MX8qxp DPU DRM driver Liu Ying
2020-11-19  9:22 ` [PATCH 7/8] arm64: imx8qxp:dtsi: Introduce DC0 subsystem Liu Ying
2020-11-19  9:22 ` [PATCH 8/8] arm64: dts: imx8qxp-mek: Enable DPU and it's prefetch engines Liu Ying
2020-11-19 17:30 ` [PATCH 0/8] drm/imx: Introduce i.MX8qxp DPU DRM Laurentiu Palcu
2020-11-20  2:23   ` Liu Ying

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1605777745-23625-5-git-send-email-victor.liu@nxp.com \
    --to=victor.liu@nxp.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).