Skip to contentSkip to conversation

Perf-ARM SPE: Adjustments for two function implementations

PATCH New SF Markus Elfring 1 participant 3 messages Dec 28, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Perf-ARM SPE: Adjustments for two function implementations

From: Markus Elfring <[email protected]>
Date: Thu, 28 Dec 2017 17:56:54 +0100

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
Delete an error message for a failed memory allocation
in arm_spe_pmu_device_dt_probe()
Delete an unnecessary return statement in __arm_spe_pmu_dev_probe()

 drivers/perf/arm_spe_pmu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/2 perf: arm_spe: Delete an error message for a failed memory allocation in arm_spe_pmu_device_dt_probe()

From: Markus Elfring <[email protected]>
Date: Thu, 28 Dec 2017 17:27:23 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/perf/arm_spe_pmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/perf/arm_spe_pmu.c +1 -3
index 8ce262fc2561..27fac8907d1d 100644
@@ -1166,9 +1166,7 @@ static int arm_spe_pmu_device_dt_probe(struct platform_device *pdev)
 
 	spe_pmu = devm_kzalloc(dev, sizeof(*spe_pmu), GFP_KERNEL);
-	if (!spe_pmu) {
-		dev_err(dev, "failed to allocate spe_pmu\n");
+	if (!spe_pmu)
 		return -ENOMEM;
-	}
 
 	spe_pmu->handle = alloc_percpu(typeof(*spe_pmu->handle));
 	if (!spe_pmu->handle)
Signature · 1 line
2.15.1
#2 lore raw

PATCH 2/2 perf: arm_spe: Delete an unnecessary return statement in __arm_spe_pmu_dev_probe()

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Thu, 28 Dec 2017 17:34:54 +0100

The script "checkpatch.pl" pointed information out like the following.

WARNING: void function return statements are not generally useful

Thus remove such a statement in the affected function.

---
 drivers/perf/arm_spe_pmu.c | 1 -
 1 file changed, 1 deletion(-)
drivers/perf/arm_spe_pmu.c +0 -1
index 27fac8907d1d..b30654f75a8c 100644
@@ -1033,7 +1033,6 @@ static void __arm_spe_pmu_dev_probe(void *info)
 		 spe_pmu->max_record_sz, spe_pmu->align, spe_pmu->features);
 
 	spe_pmu->features |= SPE_PMU_FEAT_DEV_PROBED;
-	return;
 }
 
 static void __arm_spe_pmu_reset_local(void)
Signature · 1 line
2.15.1