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

for_each_new_intel_plane_in_state() requires passing in a struct
intel_plane_state pointer, which it uses, but in many places this leads
to warning about unused but set variables. Annotate them with
__maybe_unused.

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/438ff3b257b7f85ecca5750ae8687336faee0a79.1685119007.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_atomic_plane.c
drivers/gpu/drm/i915/display/intel_cdclk.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_fbc.c

index 4125ee07a27171c987748dd9505b172ce8642948..7d9578ebae556665aa798b8d09d586574ce622db 100644 (file)
@@ -722,7 +722,7 @@ skl_next_plane_to_commit(struct intel_atomic_state *state,
 {
        struct intel_crtc_state *crtc_state =
                intel_atomic_get_new_crtc_state(state, crtc);
-       struct intel_plane_state *plane_state;
+       struct intel_plane_state __maybe_unused *plane_state;
        struct intel_plane *plane;
        int i;
 
index 1a5268e3d0a362a3293da6310da7c48910bdd13c..4207863b7b2ae5d4ad29d83deac0d875417984d1 100644 (file)
@@ -2959,7 +2959,7 @@ int intel_cdclk_atomic_check(struct intel_atomic_state *state,
 {
        const struct intel_cdclk_state *old_cdclk_state;
        const struct intel_cdclk_state *new_cdclk_state;
-       struct intel_plane_state *plane_state;
+       struct intel_plane_state __maybe_unused *plane_state;
        struct intel_plane *plane;
        int ret;
        int i;
index f23dd937c27c4087541b117f9606e4f50c005d37..b847c1c753703f0b1b24a13a552691552e8424a0 100644 (file)
@@ -971,7 +971,7 @@ static void intel_crtc_enable_flip_done(struct intel_atomic_state *state,
        const struct intel_crtc_state *crtc_state =
                intel_atomic_get_new_crtc_state(state, crtc);
        u8 update_planes = crtc_state->update_planes;
-       const struct intel_plane_state *plane_state;
+       const struct intel_plane_state __maybe_unused *plane_state;
        struct intel_plane *plane;
        int i;
 
@@ -988,7 +988,7 @@ static void intel_crtc_disable_flip_done(struct intel_atomic_state *state,
        const struct intel_crtc_state *crtc_state =
                intel_atomic_get_new_crtc_state(state, crtc);
        u8 update_planes = crtc_state->update_planes;
-       const struct intel_plane_state *plane_state;
+       const struct intel_plane_state __maybe_unused *plane_state;
        struct intel_plane *plane;
        int i;
 
@@ -5617,7 +5617,7 @@ static int intel_crtc_add_bigjoiner_planes(struct intel_atomic_state *state,
                                           struct intel_crtc *crtc,
                                           struct intel_crtc *other)
 {
-       const struct intel_plane_state *plane_state;
+       const struct intel_plane_state __maybe_unused *plane_state;
        struct intel_plane *plane;
        u8 plane_ids = 0;
        int i;
@@ -5660,7 +5660,7 @@ static int intel_atomic_check_planes(struct intel_atomic_state *state)
 {
        struct drm_i915_private *dev_priv = to_i915(state->base.dev);
        struct intel_crtc_state *old_crtc_state, *new_crtc_state;
-       struct intel_plane_state *plane_state;
+       struct intel_plane_state __maybe_unused *plane_state;
        struct intel_plane *plane;
        struct intel_crtc *crtc;
        int i, ret;
index 1966f939620192326ea009324730eda6efedb5d6..29aa029d249dd266d86f6c242e1973da440f6235 100644 (file)
@@ -1254,7 +1254,7 @@ static bool __intel_fbc_pre_update(struct intel_atomic_state *state,
 bool intel_fbc_pre_update(struct intel_atomic_state *state,
                          struct intel_crtc *crtc)
 {
-       const struct intel_plane_state *plane_state;
+       const struct intel_plane_state __maybe_unused *plane_state;
        bool need_vblank_wait = false;
        struct intel_plane *plane;
        int i;
@@ -1309,7 +1309,7 @@ static void __intel_fbc_post_update(struct intel_fbc *fbc)
 void intel_fbc_post_update(struct intel_atomic_state *state,
                           struct intel_crtc *crtc)
 {
-       const struct intel_plane_state *plane_state;
+       const struct intel_plane_state __maybe_unused *plane_state;
        struct intel_plane *plane;
        int i;
 
@@ -1408,7 +1408,7 @@ void intel_fbc_flush(struct drm_i915_private *i915,
 
 int intel_fbc_atomic_check(struct intel_atomic_state *state)
 {
-       struct intel_plane_state *plane_state;
+       struct intel_plane_state __maybe_unused *plane_state;
        struct intel_plane *plane;
        int i;