* [PATCH] drm/mipi-dbi: hide unused mipi_dbi_dcs_read_commands array
@ 2026-11-11 9:23 Arnd Bergmann
0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2026-11-11 9:23 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
Cc: Arnd Bergmann, Dmitry Baryshkov, David Lechner, Luca Ceresoli,
dri-devel, linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-11 9:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 9:23 [PATCH] drm/mipi-dbi: hide unused mipi_dbi_dcs_read_commands array Arnd Bergmann
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®