Skip to content

Commit 2c3631f

Browse files
author
Lucas De Marchi
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 <ashutosh.dixit@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240909204340.3646458-2-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 10a7210 commit 2c3631f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

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)