Commit bf07f6eb authored by Pankaj Bharadiya's avatar Pankaj Bharadiya Committed by Jani Nikula

drm/i915/pmu: Prefer drm_WARN_ON over WARN_ON

struct drm_device specific drm_WARN* macros include device information
in the backtrace, so we know what device the warnings originate from.

Prefer drm_WARN_ON over WARN_ON.
Signed-off-by: default avatarPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200504181600.18503-8-pankaj.laxminarayan.bharadiya@intel.com
parent 7bda1009
...@@ -441,7 +441,11 @@ static u64 count_interrupts(struct drm_i915_private *i915) ...@@ -441,7 +441,11 @@ static u64 count_interrupts(struct drm_i915_private *i915)
static void i915_pmu_event_destroy(struct perf_event *event) static void i915_pmu_event_destroy(struct perf_event *event)
{ {
WARN_ON(event->parent); struct drm_i915_private *i915 =
container_of(event->pmu, typeof(*i915), pmu.base);
drm_WARN_ON(&i915->drm, event->parent);
module_put(THIS_MODULE); module_put(THIS_MODULE);
} }
...@@ -1058,8 +1062,10 @@ static int i915_pmu_register_cpuhp_state(struct i915_pmu *pmu) ...@@ -1058,8 +1062,10 @@ static int i915_pmu_register_cpuhp_state(struct i915_pmu *pmu)
static void i915_pmu_unregister_cpuhp_state(struct i915_pmu *pmu) static void i915_pmu_unregister_cpuhp_state(struct i915_pmu *pmu)
{ {
WARN_ON(pmu->cpuhp.slot == CPUHP_INVALID); struct drm_i915_private *i915 = container_of(pmu, typeof(*i915), pmu);
WARN_ON(cpuhp_state_remove_instance(pmu->cpuhp.slot, &pmu->cpuhp.node));
drm_WARN_ON(&i915->drm, pmu->cpuhp.slot == CPUHP_INVALID);
drm_WARN_ON(&i915->drm, cpuhp_state_remove_instance(pmu->cpuhp.slot, &pmu->cpuhp.node));
cpuhp_remove_multi_state(pmu->cpuhp.slot); cpuhp_remove_multi_state(pmu->cpuhp.slot);
pmu->cpuhp.slot = CPUHP_INVALID; pmu->cpuhp.slot = CPUHP_INVALID;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment