From: Liao Yuanhong Date: Thu, 28 Aug 2025 12:25:09 +0000 (+0800) Subject: drivers/perf: riscv: Remove redundant ternary operators X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=01dc937ac18dd0bc0fc77c24030639553f977ffe;p=users%2Fhch%2Fmisc.git drivers/perf: riscv: Remove redundant ternary operators 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 Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20250828122510.30843-1-liaoyuanhong@vivo.com Signed-off-by: Paul Walmsley --- 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; } /*