]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 17 Dec 2021 14:59:08 +0000 (17:59 +0300)
committerWill Deacon <will@kernel.org>
Tue, 4 Jan 2022 13:58:17 +0000 (13:58 +0000)
The devm_ioremap() function does not return error pointers.  It returns
NULL.

Fixes: 398d505b88ea ("drivers: perf: Add LLC-TAD perf counter support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211217145907.GA16611@kili
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/marvell_cn10k_tad_pmu.c

index 250dd4c52d7054ab4c4d12056a088a72cb229bdd..7f4d292658e3216dfcfcafe4f5780383d0f03f38 100644 (file)
@@ -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;
                }