Skip to content

Commit 25228c6

Browse files
committed
drm/i915: Avoid open-coded use of ratelimit_state structure's ->missed field
The i915_oa_stream_destroy() function directly accesses the ratelimit_state structure's ->missed field, which works, but which also makes it more difficult to change this field. Therefore, make use of the ratelimit_state_get_miss() function instead of directly accessing the ->missed field. Link: https://lore.kernel.org/all/fbe93a52-365e-47fe-93a4-44a44547d601@paulmck-laptop/ Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Acked-by: Jani Nikula <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: David Airlie <[email protected]> Cc: Simona Vetter <[email protected]> Cc: <[email protected]> Cc: <[email protected]>
1 parent 48e864a commit 25228c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/i915/i915_perf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,6 +1666,7 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
16661666
struct i915_perf *perf = stream->perf;
16671667
struct intel_gt *gt = stream->engine->gt;
16681668
struct i915_perf_group *g = stream->engine->oa_group;
1669+
int m;
16691670

16701671
if (WARN_ON(stream != g->exclusive_stream))
16711672
return;
@@ -1690,10 +1691,9 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
16901691
free_oa_configs(stream);
16911692
free_noa_wait(stream);
16921693

1693-
if (perf->spurious_report_rs.missed) {
1694-
gt_notice(gt, "%d spurious OA report notices suppressed due to ratelimiting\n",
1695-
perf->spurious_report_rs.missed);
1696-
}
1694+
m = ratelimit_state_get_miss(&perf->spurious_report_rs);
1695+
if (m)
1696+
gt_notice(gt, "%d spurious OA report notices suppressed due to ratelimiting\n", m);
16971697
}
16981698

16991699
static void gen7_init_oa_buffer(struct i915_perf_stream *stream)

0 commit comments

Comments
 (0)