perf/x86/uncore: Remove unnecessary check for uncore_pmu
Subsystems (3)
PATCH 1/1 perf/x86/uncore: Remove unnecessary check for uncore_pmu
From: Kan Liang <[email protected]>
The uncore_pmu pointer in uncore_pmu_enable/disable() is from container_of, which never be NULL.
Remove the unnecessary check for uncore_pmu.
--- arch/x86/events/intel/uncore.c | 6 ------ 1 file changed, 6 deletions(-)
arch/x86/events/intel/uncore.c +0 -6
@@ -780,9 +780,6 @@ static void uncore_pmu_enable(struct pmu *pmu)struct intel_uncore_box *box; uncore_pmu = container_of(pmu, struct intel_uncore_pmu, pmu); -if (!uncore_pmu) -return ; - box =uncore_pmu_to_box (uncore_pmu,smp_processor_id ());if (!box)return ;
@@ -797,9 +794,6 @@ static void uncore_pmu_disable(struct pmu *pmu)struct intel_uncore_box *box; uncore_pmu = container_of(pmu, struct intel_uncore_pmu, pmu); -if (!uncore_pmu) -return ; - box =uncore_pmu_to_box (uncore_pmu,smp_processor_id ());if (!box)return ;
Signature · 1 line
2.7.4
Quoted 11 lines · On Wed 2019-11-13 05:35:02, [email protected] wrote:
From: Kan Liang <[email protected]>
The
uncore_pmupointer in uncore_pmu_enable/disable() is fromcontainer_of, which never be NULL.Remove the unnecessary check for
uncore_pmu.Fixes 75be6f703a14 ("perf/x86/uncore: Fix event group support")Reported-by Pavel Machek <[email protected]>Signed-off-by Kan Liang <[email protected]>
Thanks for doing this.
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 11 lines · On Wed 2019-11-13 05:35:02, [email protected] wrote:
From: Kan Liang <[email protected]>
The
uncore_pmupointer in uncore_pmu_enable/disable() is fromcontainer_of, which never be NULL.Remove the unnecessary check for
uncore_pmu.Fixes 75be6f703a14 ("perf/x86/uncore: Fix event group support")Reported-by Pavel Machek <[email protected]>Signed-off-by Kan Liang <[email protected]>
Sorry, sent email too fast.
I agree this is good fix for mainline, but as the code is a tiny bit ineffective but correct, I don't think we neccessarily need it in stable.
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany