linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/x86/uncore: Remove unnecessary check for uncore_pmu
@ 2019-11-13 13:35 kan.liang
  2019-11-18 14:35 ` Pavel Machek
  2019-11-18 14:36 ` Pavel Machek
  0 siblings, 2 replies; 3+ messages in thread
From: kan.liang @ 2019-11-13 13:35 UTC (permalink / raw)
  To: peterz, mingo, sashal, gregkh, pavel, linux-kernel
  Cc: ak, alexander.shishkin, Kan Liang, stable

From: Kan Liang <kan.liang@linux.intel.com>

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@denx.de>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: stable@vger.kernel.org
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/x86/uncore: Remove unnecessary check for uncore_pmu
  2019-11-13 13:35 [PATCH] perf/x86/uncore: Remove unnecessary check for uncore_pmu kan.liang
@ 2019-11-18 14:35 ` Pavel Machek
  2019-11-18 14:36 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2019-11-18 14:35 UTC (permalink / raw)
  To: kan.liang
  Cc: peterz, mingo, sashal, gregkh, pavel, linux-kernel, ak,
	alexander.shishkin, stable

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

On Wed 2019-11-13 05:35:02, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
> 
> 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@denx.de>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
> Cc: stable@vger.kernel.org

Thanks for doing this.

Acked-by: Pavel Machek <pavel@denx.de>

								Pavel
								
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/x86/uncore: Remove unnecessary check for uncore_pmu
  2019-11-13 13:35 [PATCH] perf/x86/uncore: Remove unnecessary check for uncore_pmu kan.liang
  2019-11-18 14:35 ` Pavel Machek
@ 2019-11-18 14:36 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2019-11-18 14:36 UTC (permalink / raw)
  To: kan.liang
  Cc: peterz, mingo, sashal, gregkh, pavel, linux-kernel, ak,
	alexander.shishkin, stable

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

On Wed 2019-11-13 05:35:02, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
> 
> 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@denx.de>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
> Cc: stable@vger.kernel.org

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
							
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-18 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13 13:35 [PATCH] perf/x86/uncore: Remove unnecessary check for uncore_pmu kan.liang
2019-11-18 14:35 ` Pavel Machek
2019-11-18 14:36 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).