Thread (2 messages) flat view 2 messages, 2 authors, 2022-01-05
STALE1704d LANDED

Landed in mainline as 2da56881a7f8 on 2022-01-04.

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

From: Dan Carpenter <hidden>
Date: 2021-12-17 14:59:55
Also in: kernel-janitors, lkml
Subsystem: arm pmu profiling and debugging, the rest · Maintainers: Will Deacon, Mark Rutland, Linus Torvalds

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

Fixes: 036a7584bede ("drivers: perf: Add LLC-TAD perf counter support")
Signed-off-by: Dan Carpenter <redacted>
---
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(-)
diff --git a/drivers/perf/marvell_cn10k_tad_pmu.c b/drivers/perf/marvell_cn10k_tad_pmu.c
index 250dd4c52d70..7f4d292658e3 100644
--- a/drivers/perf/marvell_cn10k_tad_pmu.c
+++ b/drivers/perf/marvell_cn10k_tad_pmu.c
@@ -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;
 		}
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help