dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Lin, Wayne" <Wayne.Lin@amd.com>
To: Arnd Bergmann <arnd@kernel.org>,
	"Wentland, Harry" <Harry.Wentland@amd.com>,
	"Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Koenig, Christian" <Christian.Koenig@amd.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	"R, Bindu" <Bindu.R@amd.com>
Cc: "Wang, Chao-kai \(Stylon\)" <Stylon.Wang@amd.com>,
	"Brol, Eryk" <Eryk.Brol@amd.com>, Arnd Bergmann <arnd@arndb.de>,
	"Siqueira, Rodrigo" <Rodrigo.Siqueira@amd.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Pillai, Aurabindo" <Aurabindo.Pillai@amd.com>,
	"Lakha, Bhawanpreet" <Bhawanpreet.Lakha@amd.com>,
	"Kazlauskas, Nicholas" <Nicholas.Kazlauskas@amd.com>
Subject: RE: [PATCH] drm/amd/display: Fix unused variable warning
Date: Mon, 4 Jan 2021 12:58:00 +0000	[thread overview]
Message-ID: <BN8PR12MB4770D2DD3E0A5ECF5EA9C55AFCD20@BN8PR12MB4770.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20210103140248.3889757-1-arnd@kernel.org>

[AMD Official Use Only - Internal Distribution Only]

Thanks Arnd.

Reviewed-by: Wayne Lin <Wayne.Lin@amd.com>

-----Original Message-----
From: Arnd Bergmann <arnd@kernel.org>
Sent: Sunday, January 3, 2021 10:03 PM
To: Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; David Airlie <airlied@linux.ie>; Daniel Vetter <daniel@ffwll.ch>; R, Bindu <Bindu.R@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>
Cc: Arnd Bergmann <arnd@arndb.de>; Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Simon Ser <contact@emersion.fr>; Brol, Eryk <Eryk.Brol@amd.com>; Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org
Subject: [PATCH] drm/amd/display: Fix unused variable warning

From: Arnd Bergmann <arnd@arndb.de>

Some of the newly added code is hidden inside of #ifdef blocks, but one variable is unused when debugfs is disabled:

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8370:8: error: unused variable 'configure_crc' [-Werror,-Wunused-variable]

Change the #ifdef to an if(IS_ENABLED()) check to fix the warning and avoid adding more #ifdefs.

Fixes: c920888c604d ("drm/amd/display: Expose new CRC window property")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c     | 4 +---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 42b0fdb72e7b..5071b55ad0f6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8379,8 +8379,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
 acrtc->dm_irq_params.stream = dm_new_crtc_state->stream;
 manage_dm_interrupts(adev, acrtc, true);
 }
-#ifdef CONFIG_DEBUG_FS
-if (new_crtc_state->active &&
+if (IS_ENABLED(CONFIG_DEBUG_FS) && new_crtc_state->active &&
 amdgpu_dm_is_valid_crc_source(dm_new_crtc_state->crc_src)) {
 /**
  * Frontend may have changed so reapply the CRC capture @@ -8401,7 +8400,6 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
 amdgpu_dm_crtc_configure_crc_source(
 crtc, dm_new_crtc_state, dm_new_crtc_state->crc_src);
 }
-#endif
 }

 for_each_new_crtc_in_state(state, crtc, new_crtc_state, j) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
index 0235bfb246e5..eba2f1d35d07 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h
@@ -46,13 +46,13 @@ static inline bool amdgpu_dm_is_valid_crc_source(enum amdgpu_dm_pipe_crc_source  }

 /* amdgpu_dm_crc.c */
-#ifdef CONFIG_DEBUG_FS
 bool amdgpu_dm_crc_window_is_default(struct dm_crtc_state *dm_crtc_state);  bool amdgpu_dm_crc_window_changed(struct dm_crtc_state *dm_new_crtc_state,
 struct dm_crtc_state *dm_old_crtc_state);  int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
 struct dm_crtc_state *dm_crtc_state,
 enum amdgpu_dm_pipe_crc_source source);
+#ifdef CONFIG_DEBUG_FS
 int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name);  int amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc,
      const char *src_name,
--
2.29.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-01-04 12:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-03 14:02 [PATCH] drm/amd/display: Fix unused variable warning Arnd Bergmann
2021-01-04 12:58 ` Lin, Wayne [this message]
2021-01-04 17:24   ` Alex Deucher
2021-01-25 12:48 [PATCH] drm/amd/display: fix " Arnd Bergmann
2021-01-25 15:39 ` Harry Wentland

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=BN8PR12MB4770D2DD3E0A5ECF5EA9C55AFCD20@BN8PR12MB4770.namprd12.prod.outlook.com \
    --to=wayne.lin@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Bindu.R@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=Eryk.Brol@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Stylon.Wang@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=airlied@linux.ie \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).