From nobody Mon Dec 15 21:47:12 2025 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40F391459FD for ; Tue, 14 Jan 2025 20:35:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736886958; cv=none; b=bYyXbK31uK0jydfZcb0Gkj6UOagXbPvtemzR1KC7LIUM2n0n8E444Kb45spjk580KuBBape+KI3LNFLLYOrfa7KEyU2iOHo8DqlA75VrOmc0m4nZNsUrwTeTToOc1y5HTtQ0eyHGD1CQUKMVc067AtCaw/4w+7FmnxUlXI9BHU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736886958; c=relaxed/simple; bh=5EHDsAh1gvS0BQE9Spp73R1FEpmpoEEz/oly6xIBojg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Kqsz2hFxAQtCNK1A7/oq9LJE7a+H+ltgN9I0c3A5jEF5gJ4HjdMEzqNW3wF6fErj4+PKOl2qeTVQ9dgkpGMFVLAzQFoCtmBL4VSfuYT4KMXnqmQjIpVexrfuB+N7CGFfmFbTzBRmNIWZAS6xgjPyCL1VV6lP2DHjPluKHlUZZ4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=GK3PAgRa; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GK3PAgRa" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4361aa6e517so7515595e9.2 for ; Tue, 14 Jan 2025 12:35:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736886954; x=1737491754; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3YEUyfDTrDdv/X9cKczpOY/bvfGujRsuEaW/USYXyac=; b=GK3PAgRas5Aa2HRds65LI6Tos9tAE8+j6/bcMaY0bMNXD4ObirARXRZ1rhqBMC8YoF NCnfU94Ty3DxDSazKhQCeTI/CKJd9ngjywPsJP70InO+aeZK0G11p8zapyG8t9htLF0z rWx4i7kdJVAIN3mOjnCxM5Cp5X9q23zaUEXtsT/AQnb9uJL3KiY1SKjDz8r8ehR0N9al yzgTF/N7eYY8KNH+laTZOHD3EQfvU1suh9LGUKKFsbpeIaE0KA8P3yEpgj3bxVGqjDv6 dFIhKRUYBom+Bdh2U3XSEmFTXuh0nEcIIW4Hwq8JNezibEtbsJ91CUSP6gr20btAdG+s z9Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736886954; x=1737491754; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3YEUyfDTrDdv/X9cKczpOY/bvfGujRsuEaW/USYXyac=; b=WJddww0E2U+ldEdXoVB9AhjilwBo/t3cJX3Fd+d0f8WjEZkHJdbdnYFhEyb0E48y7F AcJtZux6+vW3KHmvWkTpgB7q3OKaS9PRfLyGWf2Fsvshsoanwexp2469hgLfUb41rJrb +/tKqsdCfIpTMbbPqHukjXluEADDpShVU9WXHcgso44AT1Qlq4XUDQeT5zeBhu0oOnoO N2bWFpq6LjAWvk0bKFIcCUJMYTIR2YgCahPmL6/r5sct2UXUZ2DCvFH5iWCXcl6nLUpa wTp4UGvh2unYQJOAMDyHuONhKev+qZmDgvD312IAJAxO4UAyiFM2t8JHkF6Hccp54PCC psag== X-Forwarded-Encrypted: i=1; AJvYcCXMVTDDykJBnZYCCntyiVxEQx9aP5PpsInF/hlGwHibquSrph5FmUAbufQsdgyI7f/PbK45RXL+yf/qNyo=@vger.kernel.org X-Gm-Message-State: AOJu0Yzuh3EuK4F9cClRFY4WnfHqPcgOcoBXEghvw6z2dD3SbKFScuK2 1KNBZtM+QXAE5CiNAYe7ll3vWyv5EY/rbZs/fyRSomGd7H3ImVarhFxELsUk7Qk= X-Gm-Gg: ASbGnctsYO/O15c1EbwbE0KSQv5TFgsIoQEGhcPT31MkjmNif7KdovuxKegETICM4Dm G9GnVgN2cEJRCSBN2yU5PLz2rcpZQF5kBzafBYeEBz7Wnv7fGC9AUlx2cp039+a4eGOlUxljMht DbFqh5v6HKv2P1L4t61Jmk8IJAibueoNoyoYBgfdLu/VN1rd8ONG2KSigACr7fH1J7/RhcOmNfy zycWZP+ruUhTzHbUW+RaoD/8oFaneoVXXtKRIsVIfJsFNxqlR8b1aRARNYrA61PT1cu1nM= X-Google-Smtp-Source: AGHT+IEGIFldZ+L4k4Dl+6+c14xQU/JWpFaLddSCbKXPeGIlOQ60LNvgiaZaK9zGFGqW8cmq+2DOXg== X-Received: by 2002:adf:9ccd:0:b0:386:3c21:b1f7 with SMTP id ffacd0b85a97d-38a872f40f3mr8004257f8f.7.1736886954611; Tue, 14 Jan 2025 12:35:54 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1c01sm16042789f8f.97.2025.01.14.12.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 12:35:54 -0800 (PST) From: Krzysztof Kozlowski To: Geert Uytterhoeven , Magnus Damm , Ulf Hansson , Krzysztof Kozlowski , Alim Akhtar , Walker Chen , Changhuang Liang , linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH] pmdomain: Use str_enable_disable-like helpers Date: Tue, 14 Jan 2025 21:35:47 +0100 Message-ID: <20250114203547.1013010-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace ternary (condition ? "enable" : "disable") syntax with helpers from string_choices.h because: 1. Simple function call with one argument is easier to read. Ternary operator has three arguments and with wrapping might lead to quite long code. 2. Is slightly shorter thus also easier to read. 3. It brings uniformity in the text - same string. 4. Allows deduping by the linker, which results in a smaller binary file. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven --- drivers/pmdomain/renesas/rcar-gen4-sysc.c | 3 ++- drivers/pmdomain/renesas/rcar-sysc.c | 3 ++- drivers/pmdomain/samsung/exynos-pm-domains.c | 6 +++--- drivers/pmdomain/starfive/jh71xx-pmu.c | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/pmdomain/renesas/rcar-gen4-sysc.c b/drivers/pmdomain/r= enesas/rcar-gen4-sysc.c index 66409cff2083..fe9a0c1deaa3 100644 --- a/drivers/pmdomain/renesas/rcar-gen4-sysc.c +++ b/drivers/pmdomain/renesas/rcar-gen4-sysc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include =20 #include "rcar-gen4-sysc.h" @@ -171,7 +172,7 @@ static int rcar_gen4_sysc_power(u8 pdr, bool on) out: spin_unlock_irqrestore(&rcar_gen4_sysc_lock, flags); =20 - pr_debug("sysc power %s domain %d: %08x -> %d\n", on ? "on" : "off", + pr_debug("sysc power %s domain %d: %08x -> %d\n", str_on_off(on), pdr, ioread32(rcar_gen4_sysc_base + SYSCISCR(reg_idx)), ret); return ret; } diff --git a/drivers/pmdomain/renesas/rcar-sysc.c b/drivers/pmdomain/renesa= s/rcar-sysc.c index b99326917330..e3f2c7edf22a 100644 --- a/drivers/pmdomain/renesas/rcar-sysc.c +++ b/drivers/pmdomain/renesas/rcar-sysc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -162,7 +163,7 @@ static int rcar_sysc_power(const struct rcar_sysc_pd *p= d, bool on) =20 spin_unlock_irqrestore(&rcar_sysc_lock, flags); =20 - pr_debug("sysc power %s domain %d: %08x -> %d\n", on ? "on" : "off", + pr_debug("sysc power %s domain %d: %08x -> %d\n", str_on_off(on), pd->isr_bit, ioread32(rcar_sysc_base + SYSCISR), ret); return ret; } diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomai= n/samsung/exynos-pm-domains.c index 9b502e8751d1..1a892c611dad 100644 --- a/drivers/pmdomain/samsung/exynos-pm-domains.c +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ static int exynos_pd_power(struct generic_pm_domain *doma= in, bool power_on) struct exynos_pm_domain *pd; void __iomem *base; u32 timeout, pwr; - char *op; =20 pd =3D container_of(domain, struct exynos_pm_domain, pd); base =3D pd->base; @@ -51,8 +51,8 @@ static int exynos_pd_power(struct generic_pm_domain *doma= in, bool power_on) =20 while ((readl_relaxed(base + 0x4) & pd->local_pwr_cfg) !=3D pwr) { if (!timeout) { - op =3D (power_on) ? "enable" : "disable"; - pr_err("Power domain %s %s failed\n", domain->name, op); + pr_err("Power domain %s %s failed\n", domain->name, + str_enable_disable(power_on)); return -ETIMEDOUT; } timeout--; diff --git a/drivers/pmdomain/starfive/jh71xx-pmu.c b/drivers/pmdomain/star= five/jh71xx-pmu.c index 74720c09a6e3..30c29ac9391f 100644 --- a/drivers/pmdomain/starfive/jh71xx-pmu.c +++ b/drivers/pmdomain/starfive/jh71xx-pmu.c @@ -12,6 +12,7 @@ #include #include #include +#include #include =20 /* register offset */ @@ -155,7 +156,7 @@ static int jh7110_pmu_set_state(struct jh71xx_pmu_dev *= pmd, u32 mask, bool on) =20 if (ret) { dev_err(pmu->dev, "%s: failed to power %s\n", - pmd->genpd.name, on ? "on" : "off"); + pmd->genpd.name, str_on_off(on)); return -ETIMEDOUT; } =20 --=20 2.43.0