lkml.org 
[lkml]   [2019]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 3/4] devfreq: exynos-bus: Change goto-based logic to if-else logic
Date
This patch improves code readability by changing the following construct:

> if (cond)
> goto passive;
> foo();
> goto out;
> passive:
> bar();
> out:

into this:

> if (cond)
> bar();
> else
> foo();

Signed-off-by: Artur Świgoń <a.swigon@samsung.com>
---
drivers/devfreq/exynos-bus.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 19d9f9f8ced2..0b557df63666 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -427,19 +427,13 @@ static int exynos_bus_probe(struct platform_device *pdev)
goto err_reg;

if (passive)
- goto passive;
+ ret = exynos_bus_profile_init_passive(bus, profile);
+ else
+ ret = exynos_bus_profile_init(bus, profile);

- ret = exynos_bus_profile_init(bus, profile);
if (ret < 0)
goto err;

- goto out;
-passive:
- ret = exynos_bus_profile_init_passive(bus, profile);
- if (ret < 0)
- goto err;
-
-out:
max_state = bus->devfreq->profile->max_state;
min_freq = (bus->devfreq->profile->freq_table[0] / 1000);
max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000);
--
2.17.1
\
 
 \ /
  Last update: 2019-12-09 11:51    [W:0.061 / U:50.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site