* [PATCH] drm/msm/a6xx: Improve error handling in a6xx_gmu_rpmh_init()
@ 2024-02-26 18:10 Markus Elfring
0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2024-02-26 18:10 UTC (permalink / raw)
To: freedreno, dri-devel, linux-arm-msm, kernel-janitors,
Abhinav Kumar, Akhil P Oommen, Daniel Vetter, David Airlie,
Dmitry Baryshkov, Douglas Anderson, Konrad Dybcio,
Marijn Suijten, Rob Clark, Sean Paul
Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 26 Feb 2024 18:46:38 +0100
The label “err” was used as a target for two statements despite of
the implementation detail that failure conditions could be handled better.
* Thus return directly after a call of the function “a6xx_gmu_get_mmio”
failed at the beginning.
* Reorder affected statements at the end.
* Adjust a jump target.
* Omit an extra pointer check which became unnecessary
with this refactoring.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 8c4900444b2c..55a34f11eb9a 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -525,7 +525,7 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu)
bool pdc_in_aop = false;
if (IS_ERR(pdcptr))
- goto err;
+ return;
if (adreno_is_a650(adreno_gpu) ||
adreno_is_a660_family(adreno_gpu) ||
@@ -541,7 +541,7 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu)
if (!pdc_in_aop) {
seqptr = a6xx_gmu_get_mmio(pdev, "gmu_pdc_seq");
if (IS_ERR(seqptr))
- goto err;
+ goto unmap_io_pdc;
}
/* Disable SDE clock gating */
@@ -634,11 +634,11 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu)
a6xx_rpmh_stop(gmu);
-err:
- if (!IS_ERR_OR_NULL(pdcptr))
- iounmap(pdcptr);
if (!IS_ERR_OR_NULL(seqptr))
iounmap(seqptr);
+
+unmap_io_pdc:
+ iounmap(pdcptr);
}
/*
--
2.43.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-02-26 18:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-26 18:10 [PATCH] drm/msm/a6xx: Improve error handling in a6xx_gmu_rpmh_init() Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®