From: Ulf Hansson Date: Thu, 17 Apr 2025 14:25:00 +0000 (+0200) Subject: pmdomain: core: Simplify return statement in genpd_power_off() X-Git-Tag: v6.16-rc1~164^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f34a06762799e35047cad47a5db86a28174a4c4d;p=thirdparty%2Fkernel%2Flinux.git pmdomain: core: Simplify return statement in genpd_power_off() Rather than using two if-clauses immediately after each to check for similar reasons to prevent the power-off, let's combine them into one if-clause to simplify the code. Reviewed-by: Abel Vesa Tested-by: Tomi Valkeinen Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20250417142513.312939-3-ulf.hansson@linaro.org --- diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 436630bf7d7f6..25aa229374c0d 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -917,20 +917,14 @@ static void genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on, /* * Do not try to power off the domain in the following situations: - * (1) The domain is already in the "power off" state. - * (2) System suspend is in progress. + * The domain is already in the "power off" state. + * System suspend is in progress. + * The domain is configured as always on. + * The domain has a subdomain being powered on. */ - if (!genpd_status_on(genpd) || genpd->prepared_count > 0) - return; - - /* - * Abort power off for the PM domain in the following situations: - * (1) The domain is configured as always on. - * (2) When the domain has a subdomain being powered on. - */ - if (genpd_is_always_on(genpd) || - genpd_is_rpm_always_on(genpd) || - atomic_read(&genpd->sd_count) > 0) + if (!genpd_status_on(genpd) || genpd->prepared_count > 0 || + genpd_is_always_on(genpd) || genpd_is_rpm_always_on(genpd) || + atomic_read(&genpd->sd_count) > 0) return; /*