From: Arnd Bergmann <arnd@kernel.org>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: Arnd Bergmann <arnd@arndb.de>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
David Lechner <david@lechnology.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drm/mipi-dbi: hide unused mipi_dbi_dcs_read_commands array
Date: Wed, 11 Nov 2026 10:23:55 +0100 [thread overview]
Message-ID: <20261111092404.2117072-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
When -Wunused-const-variable is enabled and SPI is turned off, gcc
warns about this array being unused but defined locally:
drivers/gpu/drm/drm_mipi_dbi.c:79:17: error: 'mipi_dbi_dcs_read_commands' defined but not used [-Werror=unused-const-variable=]
79 | static const u8 mipi_dbi_dcs_read_commands[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
Move it into the block that actually uses it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/drm_mipi_dbi.c | 48 +++++++++++++++++-----------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
index 25cf04d029f7..1583f7248573 100644
--- a/drivers/gpu/drm/drm_mipi_dbi.c
+++ b/drivers/gpu/drm/drm_mipi_dbi.c
@@ -76,30 +76,6 @@
DRM_DEBUG_DRIVER("cmd=%02x, len=%zu\n", cmd, len); \
})
-static const u8 mipi_dbi_dcs_read_commands[] = {
- MIPI_DCS_GET_DISPLAY_ID,
- MIPI_DCS_GET_RED_CHANNEL,
- MIPI_DCS_GET_GREEN_CHANNEL,
- MIPI_DCS_GET_BLUE_CHANNEL,
- MIPI_DCS_GET_DISPLAY_STATUS,
- MIPI_DCS_GET_POWER_MODE,
- MIPI_DCS_GET_ADDRESS_MODE,
- MIPI_DCS_GET_PIXEL_FORMAT,
- MIPI_DCS_GET_DISPLAY_MODE,
- MIPI_DCS_GET_SIGNAL_MODE,
- MIPI_DCS_GET_DIAGNOSTIC_RESULT,
- MIPI_DCS_READ_MEMORY_START,
- MIPI_DCS_READ_MEMORY_CONTINUE,
- MIPI_DCS_GET_SCANLINE,
- MIPI_DCS_GET_DISPLAY_BRIGHTNESS,
- MIPI_DCS_GET_CONTROL_DISPLAY,
- MIPI_DCS_GET_POWER_SAVE,
- MIPI_DCS_GET_CABC_MIN_BRIGHTNESS,
- MIPI_DCS_READ_DDB_START,
- MIPI_DCS_READ_DDB_CONTINUE,
- 0, /* sentinel */
-};
-
static bool mipi_dbi_command_is_read(struct mipi_dbi *dbi, u8 cmd)
{
unsigned int i;
@@ -1096,6 +1072,30 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *dbi, u8 *cmd,
return ret;
}
+static const u8 mipi_dbi_dcs_read_commands[] = {
+ MIPI_DCS_GET_DISPLAY_ID,
+ MIPI_DCS_GET_RED_CHANNEL,
+ MIPI_DCS_GET_GREEN_CHANNEL,
+ MIPI_DCS_GET_BLUE_CHANNEL,
+ MIPI_DCS_GET_DISPLAY_STATUS,
+ MIPI_DCS_GET_POWER_MODE,
+ MIPI_DCS_GET_ADDRESS_MODE,
+ MIPI_DCS_GET_PIXEL_FORMAT,
+ MIPI_DCS_GET_DISPLAY_MODE,
+ MIPI_DCS_GET_SIGNAL_MODE,
+ MIPI_DCS_GET_DIAGNOSTIC_RESULT,
+ MIPI_DCS_READ_MEMORY_START,
+ MIPI_DCS_READ_MEMORY_CONTINUE,
+ MIPI_DCS_GET_SCANLINE,
+ MIPI_DCS_GET_DISPLAY_BRIGHTNESS,
+ MIPI_DCS_GET_CONTROL_DISPLAY,
+ MIPI_DCS_GET_POWER_SAVE,
+ MIPI_DCS_GET_CABC_MIN_BRIGHTNESS,
+ MIPI_DCS_READ_DDB_START,
+ MIPI_DCS_READ_DDB_CONTINUE,
+ 0, /* sentinel */
+};
+
/**
* mipi_dbi_spi_init - Initialize MIPI DBI SPI interface
* @spi: SPI device
--
2.53.0
reply other threads:[~2026-11-11 9:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261111092404.2117072-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=airlied@gmail.com \
--cc=arnd@arndb.de \
--cc=david@lechnology.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--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
all inboxes | Powered by JetHome®