]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/imagination: avoid unused-const-variable warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 9 Apr 2025 12:22:53 +0000 (14:22 +0200)
committerMatt Coster <matt.coster@imgtec.com>
Thu, 24 Apr 2025 09:51:55 +0000 (10:51 +0100)
commit3206a96675342badb0254558ba4b4c8764aa3ae7
treeaf400600299139dbdc2c91ed3d3c8f0fd4f06a4b
parent0228687423587d8ef448fc1d81f96539507aa5bb
drm/imagination: avoid unused-const-variable warning

When CONFIG_DEBUG_FS is disabled, the stid_fmts[] array is not referenced
anywhere, causing a W=1 warning with gcc:

In file included from drivers/gpu/drm/imagination/pvr_fw_trace.c:7:
drivers/gpu/drm/imagination/pvr_rogue_fwif_sf.h:75:39: error: 'stid_fmts' defined but not used [-Werror=unused-const-variable=]
   75 | static const struct rogue_km_stid_fmt stid_fmts[] = {
      |                                       ^~~~~~~~~

Rather than adding more #ifdef blocks, address this by changing the
existing #ifdef into equivalent IS_ENABLED() checks so gcc can see
where the symbol is used but still eliminate it from the object file.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Link: https://lore.kernel.org/r/20250409122314.2848028-1-arnd@kernel.org
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
drivers/gpu/drm/imagination/pvr_fw_trace.c
drivers/gpu/drm/imagination/pvr_fw_trace.h