[PATCH] perf/x86/uncore: Remove unnecessary check for uncore_pmu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>

The uncore_pmu pointer in uncore_pmu_enable/disable() is from
container_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 <pavel@xxxxxxx>
Signed-off-by: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
---
 arch/x86/events/intel/uncore.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 86467f8..81eed07 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -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;
-- 
2.7.4




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux