From: Arnd Bergmann <arnd@arndb.de>
To: "Harry Wentland" <harry.wentland@amd.com>,
"Leo Li" <sunpeng.li@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David (ChunMing) Zhou" <David1.Zhou@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>
Cc: Arnd Bergmann <arnd@arndb.de>,
Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>,
Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
Roman Li <roman.li@amd.com>,
Mikita Lipski <mikita.lipski@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] drm/amdgpu/display: avoid unused-variable warning
Date: Wed, 8 Apr 2020 21:12:46 +0200 [thread overview]
Message-ID: <20200408191305.1179310-1-arnd@arndb.de> (raw)
Without CONFIG_DEBUG_FS, this newly added function causes a harmless
warning:
amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_dm_connector_late_register':
amdgpu_dm/amdgpu_dm.c:4723:30: error: unused variable 'amdgpu_dm_connector' [-Werror=unused-variable]
4723 | struct amdgpu_dm_connector *amdgpu_dm_connector =
| ^~~~~~~~~~~~~~~~~~~
Use an IS_ENABLED() check instead to let the compiler see what
is going on.
Fixes: 14f04fa4834a ("drm/amdgpu/display: add a late register connector callback")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++-----
1 file changed, 2 insertions(+), 5 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 d3674d805a0a..8ab23fe98059 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -51,9 +51,7 @@
#include "amdgpu_dm_irq.h"
#include "dm_helpers.h"
#include "amdgpu_dm_mst_types.h"
-#if defined(CONFIG_DEBUG_FS)
#include "amdgpu_dm_debugfs.h"
-#endif
#include "ivsrcid/ivsrcid_vislands30.h"
@@ -4723,9 +4721,8 @@ amdgpu_dm_connector_late_register(struct drm_connector *connector)
struct amdgpu_dm_connector *amdgpu_dm_connector =
to_amdgpu_dm_connector(connector);
-#if defined(CONFIG_DEBUG_FS)
- connector_debugfs_init(amdgpu_dm_connector);
-#endif
+ if (IS_ENABLED(CONFIG_DEBUG_FS))
+ connector_debugfs_init(amdgpu_dm_connector);
return 0;
}
--
2.26.0
next reply other threads:[~2020-04-08 19:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-08 19:12 Arnd Bergmann [this message]
2020-04-08 19:17 ` [PATCH] drm/amdgpu/display: avoid unused-variable warning Alex Deucher
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=20200408191305.1179310-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=David1.Zhou@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikita.lipski@amd.com \
--cc=nicholas.kazlauskas@amd.com \
--cc=roman.li@amd.com \
--cc=sunpeng.li@amd.com \
/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).