diff mbox series

[27/42] drm/selftests/test-drm_mm: Mark 'hole_end' as always_unused

Message ID 20201116174112.1833368-28-lee.jones@linaro.org
State Accepted
Commit 7df5428975e97818b30d2b800c9e8b0734ea8da9
Headers show
Series Rid W=1 warnings from GPU (non-Radeon) | expand

Commit Message

Lee Jones Nov. 16, 2020, 5:40 p.m. UTC
In the macro drm_mm_for_each_hole() 'hole_end' is provided as a
container for 'hole_start + pos->hole_size', but is not utilised in
this use-case.  We cannot simply delete the variable, so here we tell
the compiler that we're intentionally discarding the read value.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/selftests/test-drm_mm.c: In function ‘assert_no_holes’:
 drivers/gpu/drm/selftests/test-drm_mm.c:57:18: warning: variable ‘hole_end’ set but not used [-Wunused-but-set-variable]

Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/gpu/drm/selftests/test-drm_mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c
index 95e212a9a74d2..b768b53c4aee3 100644
--- a/drivers/gpu/drm/selftests/test-drm_mm.c
+++ b/drivers/gpu/drm/selftests/test-drm_mm.c
@@ -54,7 +54,7 @@  static int igt_sanitycheck(void *ignored)
 static bool assert_no_holes(const struct drm_mm *mm)
 {
 	struct drm_mm_node *hole;
-	u64 hole_start, hole_end;
+	u64 hole_start, __always_unused hole_end;
 	unsigned long count;
 
 	count = 0;