mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86/amd/pmf: Remove redundant ternary operators
@ 2025-08-28 12:26 Liao Yuanhong
  2025-09-04 13:23 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: Liao Yuanhong @ 2025-08-28 12:26 UTC (permalink / raw)
  To: Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
	open list:AMD PMF DRIVER, open list
  Cc: Liao Yuanhong

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 drivers/platform/x86/amd/pmf/sps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/amd/pmf/sps.c b/drivers/platform/x86/amd/pmf/sps.c
index 49e14ca94a9e..c28f3c5744c2 100644
--- a/drivers/platform/x86/amd/pmf/sps.c
+++ b/drivers/platform/x86/amd/pmf/sps.c
@@ -283,7 +283,7 @@ int amd_pmf_set_sps_power_limits(struct amd_pmf_dev *pmf)
 
 bool is_pprof_balanced(struct amd_pmf_dev *pmf)
 {
-	return (pmf->current_profile == PLATFORM_PROFILE_BALANCED) ? true : false;
+	return pmf->current_profile == PLATFORM_PROFILE_BALANCED;
 }
 
 static int amd_pmf_profile_get(struct device *dev,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86/amd/pmf: Remove redundant ternary operators
  2025-08-28 12:26 [PATCH] platform/x86/amd/pmf: Remove redundant ternary operators Liao Yuanhong
@ 2025-09-04 13:23 ` Ilpo Järvinen
  0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-09-04 13:23 UTC (permalink / raw)
  To: Shyam Sundar S K, Hans de Goede, platform-driver-x86,
	linux-kernel, Liao Yuanhong

On Thu, 28 Aug 2025 20:26:48 +0800, Liao Yuanhong wrote:

> For ternary operators in the form of "a ? true : false", if 'a' itself
> returns a boolean result, the ternary operator can be omitted. Remove
> redundant ternary operators to clean up the code.
> 
> 


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86/amd/pmf: Remove redundant ternary operators
      commit: f490253809c8dab4af62e787f5a3ac3d22aa869c

--
 i.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-04 13:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-28 12:26 [PATCH] platform/x86/amd/pmf: Remove redundant ternary operators Liao Yuanhong
2025-09-04 13:23 ` Ilpo Järvinen

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®