From: Lucas De Marchi Date: Mon, 9 Sep 2024 20:43:40 +0000 (-0700) Subject: drm/i915/pmu: Use event_to_pmu() X-Git-Tag: v6.13-rc1~122^2~16^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c3631fbd8834e64a5e1c903256619886d0b6b35;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://patchwork.freedesktop.org/patch/msgid/20240909204340.3646458-2-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi --- diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index 34d798245fac9..67b6cbdeff1da 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -834,15 +834,14 @@ static void i915_pmu_event_start(struct perf_event *event, int flags) static void i915_pmu_event_stop(struct perf_event *event, int flags) { - struct drm_i915_private *i915 = - container_of(event->pmu, typeof(*i915), pmu.base); - struct i915_pmu *pmu = &i915->pmu; + struct i915_pmu *pmu = event_to_pmu(event); if (pmu->closed) goto out; if (flags & PERF_EF_UPDATE) i915_pmu_event_read(event); + i915_pmu_disable(event); out: