[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3e113599-2d99-4585-af14-a93cafe11d33@linux.dev>
Date: Fri, 5 Sep 2025 11:04:55 -0700
From: Atish Patra <atish.patra@...ux.dev>
To: Liao Yuanhong <liaoyuanhong@...o.com>, Anup Patel <anup@...infault.org>,
Will Deacon <will@...nel.org>, Mark Rutland <mark.rutland@....com>,
Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt
<palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>,
"open list:RISC-V PMU DRIVERS" <linux-riscv@...ts.infradead.org>,
"moderated list:ARM PMU PROFILING AND DEBUGGING"
<linux-arm-kernel@...ts.infradead.org>,
"open list:ARM PMU PROFILING AND DEBUGGING"
<linux-perf-users@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drivers/perf: riscv: Remove redundant ternary operators
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@...o.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@...osinc.com>
Powered by blists - more mailing lists