drm/i915/selftest: annotate maybe unused but set variable unused
authorJani Nikula <jani.nikula@intel.com>
Fri, 26 May 2023 16:38:04 +0000 (19:38 +0300)
committerJani Nikula <jani.nikula@intel.com>
Wed, 7 Jun 2023 10:25:00 +0000 (13:25 +0300)
Prepare for re-enabling -Wunused-but-set-variable.

The variable is indeed 'unused' as the name suggests, but we can't just
drop it because i915_vma_unbind_unlocked() is annotated
__must_check. Apparently the selftest does not really need to check the
value.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e7654682f6bd6a9f6af74f4b6eb5fff7b527e412.1685119007.git.jani.nikula@intel.com
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c

index 36940ef10108dca8c3a09484159bc40217bf9e99..5c397a2df70e28ce2e816b77b9cc7ba697f549c5 100644 (file)
@@ -391,7 +391,7 @@ static void close_object_list(struct list_head *objects,
                              struct i915_address_space *vm)
 {
        struct drm_i915_gem_object *obj, *on;
-       int ignored;
+       int __maybe_unused ignored;
 
        list_for_each_entry_safe(obj, on, objects, st_link) {
                struct i915_vma *vma;