From nobody Tue Dec 16 05:46:34 2025 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 073243DABE0 for ; Tue, 14 Jan 2025 10:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736852177; cv=none; b=jEldI+5+hTJ/0J1eJ2iVtcA2402nSxY+VPt9uOF8pTy9L0aZ+feiOjd0KV+dh/wTPqhD9DIozatUcpjivUl0cS6ZedjDnMvno4WEf6hHEBAmXuUBbRSj/PhokeLvZ4pEAY8dVGk4ySqwkPDVTzlPpOsyH87iIdMw4hl4BgK5Cc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736852177; c=relaxed/simple; bh=apw9YRbIZ1vmrPQOI1/lMVImDpyDtn8TVgIS0tClx/8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZDoVr4ShaXa1G5eivpPbJLoT6o3U6mpLgUBP1fflO6q4mIubDcQAwaKPEszjdhaSkFlcoWBvctXSY15EGZ4cz2T9sOqNs5ndw37rsOCrH2t1IahkbYL61YicLFfP5YUiUylTwDm7bQc3Pff8g6RdrH73/7If+KWmr1FIJcB0N2c= 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=OU/O7M33; arc=none smtp.client-ip=209.85.218.45 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="OU/O7M33" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-ab30614c1d6so53646366b.1 for ; Tue, 14 Jan 2025 02:56:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736852174; x=1737456974; 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=/9oSrldtgC1P5MkOGOlIxpHFkeRWTLigJBFqOxmE9I8=; b=OU/O7M33UZQhjE1xPYGHXdbPcTDJ8kJzCbhIiSjWBYDtR6eVl7HAX3M16Jpz8BNjaz joJT+F9VlIf+NDzT9V1F8X0QaUwDeb+lBD6yXhp527Ln+tv+EbLXdQhbcbSjk0/RHiK7 gCrMM/LMTS0ojNtiz1oNjYQH0AXqA0IvTZ7PwkU9bsXddkIiP91hA682PHZfRoFWLOun QiMA7c0KVv5SMduYg90el6oDFzbNgxa50cExSHYrPiSnDYgA1WzbfIDF7tRHFkpo6f8i WkA9tAygAp0wIWAVOGSu0xHem/PgRMBSeHYiCVQePoSLWzaFZQRXbkXUffeF2OeHvA2+ ucBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736852174; x=1737456974; 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=/9oSrldtgC1P5MkOGOlIxpHFkeRWTLigJBFqOxmE9I8=; b=Ei8HUKX9K2nplmXSkg52aJVbJb82NgSWZksqnaYwjABa4mbMp4KHt4fL/SUgz5PLKl O1/lfdLHh5G3gvCk/1Hmr4y2l2Fqz894pXb1nV+a1fU8+ZWrQhjr2ROBw3Hg5M3xWNjB 1u8enUHL4ehhM2/dshsRa5IpTcm0+U7+9fO/Tt4x1v4XMqfFYOr4aTHmwMaNpZlWDuCu 61eJAb+yKhRJJP0M+KPw5kdAoNZ139+UKrEljofkv1wpX6CwDJ/Nll4x3WCdIIrsWzeY PGbKH5UoOtItaOZdb2qdLU/iQ1kRauoqXm+TuuAfi15/TGXoM/3ICv98qHJuQvTPL/ZN 57Tg== X-Forwarded-Encrypted: i=1; AJvYcCUR5Xpgl4sC1lZV4Mx5IzXC01CALsLOlA67m+AOoLZZxx8CrGtSZTaquswC2kpwAOZhju6FTycW1ORhgQs=@vger.kernel.org X-Gm-Message-State: AOJu0YyIUy0qkofZw+7UaAc5PkstIKnSv01yxD4uYYsX+wroeNLU+axJ wlOawPnTL+qGr/P9jp8vE9b1aLDmZZzEckkE5ogdmiZBcjVZz1d7uBW3WHnOJLE= X-Gm-Gg: ASbGncuoR1jzOO2MMXOyGUOXk5X3e5grHzg7HNKFIR52hct3UpkRPa1hDoon6dDoz5K ehfEYopstdyCtcvA4LGT+/GDxx3aJdz9KLJilFhK3Aj/ncIndFNbC9acrgFa7wCrhEVvcRzBTbT tBrslKF5qyJnxMoTb8tAoYZ8MUdeelE6rbWrpOaynykOk0wTY6SWcYnX/Glil9nmxVenQBVUT9B kKZMIGcOLrHhDGJVj2cm/IGH3TEIFjJb94O35c+LKDPtKBz0WQ9tISN2hcdLng/vZx2ZhQ= X-Google-Smtp-Source: AGHT+IELLCYYvHKb5lpw7z0EW5WhiA9Rzrdg/loEMvWoWRnv3YcLbL4xd0LbtlI+AziAeBNghsD6uQ== X-Received: by 2002:a17:907:2d92:b0:aa6:9631:923f with SMTP id a640c23a62f3a-ab2abc9519fmr845034066b.12.1736852174367; Tue, 14 Jan 2025 02:56:14 -0800 (PST) Received: from krzk-bin.. ([178.197.223.165]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95b215esm611700266b.161.2025.01.14.02.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 02:56:13 -0800 (PST) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Viresh Kumar , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: Krzysztof Kozlowski Subject: [PATCH] cpufreq: Use str_enable_disable-like helpers Date: Tue, 14 Jan 2025 11:56:11 +0100 Message-ID: <20250114105611.273202-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 --- drivers/cpufreq/cpufreq.c | 7 ++++--- drivers/cpufreq/powernv-cpufreq.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 418236fef172..fba62124b56a 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -602,12 +603,12 @@ static ssize_t store_boost(struct kobject *kobj, stru= ct kobj_attribute *attr, =20 if (cpufreq_boost_trigger_state(enable)) { pr_err("%s: Cannot %s BOOST!\n", - __func__, enable ? "enable" : "disable"); + __func__, str_enable_disable(enable)); return -EINVAL; } =20 pr_debug("%s: cpufreq BOOST %s\n", - __func__, enable ? "enabled" : "disabled"); + __func__, str_enable_disable(enable)); =20 return count; } @@ -2812,7 +2813,7 @@ int cpufreq_boost_trigger_state(int state) write_unlock_irqrestore(&cpufreq_driver_lock, flags); =20 pr_err("%s: Cannot %s BOOST\n", - __func__, state ? "enable" : "disable"); + __func__, str_enable_disable(state)); =20 return ret; } diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cp= ufreq.c index 8de759247771..ae79d909943b 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -281,7 +282,7 @@ static int init_powernv_pstates(void) pr_info("cpufreq pstate min 0x%x nominal 0x%x max 0x%x\n", pstate_min, pstate_nominal, pstate_max); pr_info("Workload Optimized Frequency is %s in the platform\n", - (powernv_pstate_info.wof_enabled) ? "enabled" : "disabled"); + str_enabled_disabled(powernv_pstate_info.wof_enabled)); =20 pstate_ids =3D of_get_property(power_mgt, "ibm,pstate-ids", &len_ids); if (!pstate_ids) { --=20 2.43.0