Skip to contentSkip to conversation

drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check

PATCH Applied Dan Carpenter 2 participants 2 messages Dec 17, 2021 – Jan 5, 2022

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

PATCH 1/1 drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check

The devm_ioremap() function does not return error pointers. It returns NULL.

Fixes 036a7584bede ("drivers: perf: Add LLC-TAD perf counter support")

---
When you're adding a new driver please use the correct prefix for the first commit:

Bad: subsystem: Add new driver for Fancy New Hardware
Good: subsystem/new_hdwr: Add new driver for Fancy New Hardware

Otherwise it's impossible to guess which prefix you prefer.

 drivers/perf/marvell_cn10k_tad_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/marvell_cn10k_tad_pmu.c +1 -1
index 250dd4c52d70..7f4d292658e3 100644
@@ -312,7 +312,7 @@ static int tad_pmu_probe(struct platform_device *pdev)
 		regions[i].base = devm_ioremap(&pdev->dev,
 					       res->start,
 					       tad_pmu_page_size);
-		if (IS_ERR(regions[i].base)) {
+		if (!regions[i].base) {
 			dev_err(&pdev->dev, "TAD%d ioremap fail\n", i);
 			return -ENOMEM;
 		}
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Dan Carpenter

The devm_ioremap() function does not return error pointers. It returns NULL.

Applied to will (for-next/perf), thanks!

[1/1] drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check

      https://git.kernel.org/will/c/2da56881a7f8

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev