Skip to content

Commit 2c3631f

Browse files
committed
drm/i915/pmu: Use event_to_pmu()
i915 pointer is not needed in this function and all the others simply calculate the i915_pmu container based on the event->pmu. Follow the same logic as in other functions. Reviewed-by: Ashutosh Dixit <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 10a7210 commit 2c3631f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/i915/i915_pmu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,15 +834,14 @@ static void i915_pmu_event_start(struct perf_event *event, int flags)
834834

835835
static void i915_pmu_event_stop(struct perf_event *event, int flags)
836836
{
837-
struct drm_i915_private *i915 =
838-
container_of(event->pmu, typeof(*i915), pmu.base);
839-
struct i915_pmu *pmu = &i915->pmu;
837+
struct i915_pmu *pmu = event_to_pmu(event);
840838

841839
if (pmu->closed)
842840
goto out;
843841

844842
if (flags & PERF_EF_UPDATE)
845843
i915_pmu_event_read(event);
844+
846845
i915_pmu_disable(event);
847846

848847
out:

0 commit comments

Comments
 (0)