* [PATCH] drivers/perf: riscv: Remove redundant ternary operators
@ 2025-08-28 12:25 Liao Yuanhong
2025-09-05 18:04 ` Atish Patra
2025-09-18 15:20 ` patchwork-bot+linux-riscv
0 siblings, 2 replies; 3+ messages in thread
From: Liao Yuanhong @ 2025-08-28 12:25 UTC (permalink / raw)
To: Atish Patra, Anup Patel, Will Deacon, Mark Rutland, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
open list:RISC-V PMU DRIVERS,
moderated list:ARM PMU PROFILING AND DEBUGGING,
open list:ARM PMU PROFILING AND DEBUGGING, 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/perf/riscv_pmu_sbi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
index 698de8ddf895..c18dbffa9834 100644
--- a/drivers/perf/riscv_pmu_sbi.c
+++ b/drivers/perf/riscv_pmu_sbi.c
@@ -339,7 +339,7 @@ static bool pmu_sbi_ctr_is_fw(int cidx)
if (!info)
return false;
- return (info->type == SBI_PMU_CTR_TYPE_FW) ? true : false;
+ return info->type == SBI_PMU_CTR_TYPE_FW;
}
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/perf: riscv: Remove redundant ternary operators
2025-08-28 12:25 [PATCH] drivers/perf: riscv: Remove redundant ternary operators Liao Yuanhong
@ 2025-09-05 18:04 ` Atish Patra
2025-09-18 15:20 ` patchwork-bot+linux-riscv
1 sibling, 0 replies; 3+ messages in thread
From: Atish Patra @ 2025-09-05 18:04 UTC (permalink / raw)
To: Liao Yuanhong, Anup Patel, Will Deacon, Mark Rutland,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
open list:RISC-V PMU DRIVERS,
moderated list:ARM PMU PROFILING AND DEBUGGING,
open list:ARM PMU PROFILING AND DEBUGGING, open list
On 8/28/25 5:25 AM, 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.
>
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> ---
> drivers/perf/riscv_pmu_sbi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
> index 698de8ddf895..c18dbffa9834 100644
> --- a/drivers/perf/riscv_pmu_sbi.c
> +++ b/drivers/perf/riscv_pmu_sbi.c
> @@ -339,7 +339,7 @@ static bool pmu_sbi_ctr_is_fw(int cidx)
> if (!info)
> return false;
>
> - return (info->type == SBI_PMU_CTR_TYPE_FW) ? true : false;
> + return info->type == SBI_PMU_CTR_TYPE_FW;
> }
>
> /*
Reviewed-by: Atish Patra <atishp@rivosinc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/perf: riscv: Remove redundant ternary operators
2025-08-28 12:25 [PATCH] drivers/perf: riscv: Remove redundant ternary operators Liao Yuanhong
2025-09-05 18:04 ` Atish Patra
@ 2025-09-18 15:20 ` patchwork-bot+linux-riscv
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-riscv @ 2025-09-18 15:20 UTC (permalink / raw)
To: Liao Yuanhong
Cc: linux-riscv, atish.patra, anup, will, mark.rutland, paul.walmsley,
palmer, aou, alex, linux-arm-kernel, linux-perf-users,
linux-kernel
Hello:
This patch was applied to riscv/linux.git (for-next)
by Paul Walmsley <pjw@kernel.org>:
On Thu, 28 Aug 2025 20:25:09 +0800 you 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.
>
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> ---
> drivers/perf/riscv_pmu_sbi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- drivers/perf: riscv: Remove redundant ternary operators
https://git.kernel.org/riscv/c/01dc937ac18d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-18 15:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 12:25 [PATCH] drivers/perf: riscv: Remove redundant ternary operators Liao Yuanhong
2025-09-05 18:04 ` Atish Patra
2025-09-18 15:20 ` patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).